Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_drawutils.cpp
Go to the documentation of this file.
1// Copyright 2020 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#include "core/fxge/cfx_drawutils.h"
8
9#include "core/fxge/cfx_fillrenderoptions.h"
10#include "core/fxge/cfx_graphstatedata.h"
11#include "core/fxge/cfx_path.h"
12#include "core/fxge/cfx_renderdevice.h"
13#include "third_party/base/check.h"
14
15// static
17 const CFX_Matrix& user_to_device,
18 const CFX_FloatRect& view_bounding_box) {
19 DCHECK(render_device);
20 CFX_Path path;
21 path.AppendPoint(CFX_PointF(view_bounding_box.left, view_bounding_box.top),
23 path.AppendPoint(CFX_PointF(view_bounding_box.left, view_bounding_box.bottom),
26 CFX_PointF(view_bounding_box.right, view_bounding_box.bottom),
28 path.AppendPoint(CFX_PointF(view_bounding_box.right, view_bounding_box.top),
30 path.AppendPoint(CFX_PointF(view_bounding_box.left, view_bounding_box.top),
32
33 CFX_GraphStateData graph_state_data;
34 graph_state_data.m_DashArray = {1.0f};
35 graph_state_data.m_DashPhase = 0;
36 graph_state_data.m_LineWidth = 1.0f;
37
38 render_device->DrawPath(path, &user_to_device, &graph_state_data, 0,
39 ArgbEncode(255, 0, 0, 0),
41}
static void DrawFocusRect(CFX_RenderDevice *render_device, const CFX_Matrix &user_to_device, const CFX_FloatRect &view_bounding_box)
void AppendPoint(const CFX_PointF &point, Point::Type type)
Definition cfx_path.cpp:289
bool DrawPath(const CFX_Path &path, const CFX_Matrix *pObject2Device, const CFX_GraphStateData *pGraphState, uint32_t fill_color, uint32_t stroke_color, const CFX_FillRenderOptions &fill_options)
constexpr FX_ARGB ArgbEncode(uint32_t a, uint32_t r, uint32_t g, uint32_t b)
Definition fx_dib.h:118
static constexpr CFX_FillRenderOptions EvenOddOptions()