Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SkClipStackUtils.cpp
Go to the documentation of this file.
1/*
2* Copyright 2019 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
9
10#include "include/core/SkPath.h"
14
15enum class SkClipOp;
16
18 path->reset();
20
22 while (const SkClipStack::Element* element = iter.next()) {
23 if (element->getDeviceSpaceType() == SkClipStack::Element::DeviceSpaceType::kShader) {
24 // TODO: Handle DeviceSpaceType::kShader somehow; it can't be turned into an SkPath
25 // but perhaps the pdf backend can apply shaders in another way.
26 continue;
27 }
28 SkPath operand;
29 if (element->getDeviceSpaceType() != SkClipStack::Element::DeviceSpaceType::kEmpty) {
30 element->asDeviceSpacePath(&operand);
31 }
32
33 SkClipOp elementOp = element->getOp();
34 if (element->isReplaceOp()) {
35 *path = operand;
36 // TODO: Once expanding clip ops are removed, we can switch the iterator to be top
37 // to bottom, which allows us to break here on encountering a replace op.
38 } else {
39 Op(*path, operand, (SkPathOp)elementOp, path);
40 }
41 }
42}
SkClipOp
Definition: SkClipOp.h:13
void SkClipStack_AsPath(const SkClipStack &cs, SkPath *path)
SkPathOp
Definition: SkPathOps.h:22
@ kEmpty
This element makes the clip empty (regardless of previous elements).
const Element * next()
Definition: SkPath.h:59
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57