Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: src/core/SkPictureCommon.h

Issue 2036783005: Add nested SkPictureImageFilters to the GPU veto. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 // Some shared code used by both SkBigPicture and SkMiniPicture. 8 // Some shared code used by both SkBigPicture and SkMiniPicture.
9 // SkTextHunter -- SkRecord visitor that returns true when the op draws text . 9 // SkTextHunter -- SkRecord visitor that returns true when the op draws text .
10 // SkBitmapHunter -- SkRecord visitor that returns true when the op draws a bi tmap or image. 10 // SkBitmapHunter -- SkRecord visitor that returns true when the op draws a bi tmap or image.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void operator()(const SkRecords::DrawPicture& op) { 84 void operator()(const SkRecords::DrawPicture& op) {
85 fNumSlowPathsAndDashEffects += op.picture->numSlowPaths(); 85 fNumSlowPathsAndDashEffects += op.picture->numSlowPaths();
86 } 86 }
87 void operator()(const SkRecords::DrawDrawable&) { /* TODO */ } 87 void operator()(const SkRecords::DrawDrawable&) { /* TODO */ }
88 88
89 void checkPaint(const SkPaint* paint) { 89 void checkPaint(const SkPaint* paint) {
90 if (paint && paint->getPathEffect()) { 90 if (paint && paint->getPathEffect()) {
91 // Initially assume it's slow. 91 // Initially assume it's slow.
92 fNumSlowPathsAndDashEffects++; 92 fNumSlowPathsAndDashEffects++;
93 } 93 }
94 if (paint && paint->getImageFilter()) {
95 fNumSlowPathsAndDashEffects += paint->getImageFilter()->numSlowPaths ();
96 }
94 } 97 }
95 98
96 void operator()(const SkRecords::DrawPoints& op) { 99 void operator()(const SkRecords::DrawPoints& op) {
97 this->checkPaint(&op.paint); 100 this->checkPaint(&op.paint);
98 const SkPathEffect* effect = op.paint.getPathEffect(); 101 const SkPathEffect* effect = op.paint.getPathEffect();
99 if (effect) { 102 if (effect) {
100 SkPathEffect::DashInfo info; 103 SkPathEffect::DashInfo info;
101 SkPathEffect::DashType dashType = effect->asADash(&info); 104 SkPathEffect::DashType dashType = effect->asADash(&info);
102 if (2 == op.count && SkPaint::kRound_Cap != op.paint.getStrokeCap() && 105 if (2 == op.count && SkPaint::kRound_Cap != op.paint.getStrokeCap() &&
103 SkPathEffect::kDash_DashType == dashType && 2 == info.fCount) { 106 SkPathEffect::kDash_DashType == dashType && 2 == info.fCount) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 template <typename T> 140 template <typename T>
138 SK_WHEN(T::kTags & SkRecords::kDraw_Tag, void) operator()(const T& op) { 141 SK_WHEN(T::kTags & SkRecords::kDraw_Tag, void) operator()(const T& op) {
139 this->checkPaint(AsPtr(op.paint)); 142 this->checkPaint(AsPtr(op.paint));
140 } 143 }
141 144
142 template <typename T> 145 template <typename T>
143 SK_WHEN(!(T::kTags & SkRecords::kDraw_Tag), void) operator()(const T& op) { /* do nothing */ } 146 SK_WHEN(!(T::kTags & SkRecords::kDraw_Tag), void) operator()(const T& op) { /* do nothing */ }
144 147
145 int fNumSlowPathsAndDashEffects; 148 int fNumSlowPathsAndDashEffects;
146 }; 149 };
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698