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

Side by Side Diff: src/core/SkPictureAnalyzer.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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/SkLiteRecorder.cpp ('k') | src/core/SkPictureFlat.h » ('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 2016 Google Inc. 2 * Copyright 2016 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 #include "SkPath.h" 8 #include "SkPath.h"
9 #include "SkPicture.h" 9 #include "SkPicture.h"
10 #include "SkPictureAnalyzer.h" 10 #include "SkPictureAnalyzer.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) { 33 void SkPictureGpuAnalyzer::analyzePicture(const SkPicture* picture) {
34 if (!picture) { 34 if (!picture) {
35 return; 35 return;
36 } 36 }
37 37
38 fNumSlowPaths += picture->numSlowPaths(); 38 fNumSlowPaths += picture->numSlowPaths();
39 } 39 }
40 40
41 void SkPictureGpuAnalyzer::analyzeClipPath(const SkPath& path, SkRegion::Op op, bool doAntiAlias) { 41 void SkPictureGpuAnalyzer::analyzeClipPath(const SkPath& path, SkCanvas::ClipOp op, bool doAntiAlias) {
42 const SkRecords::ClipPath clipOp = { 42 const SkRecords::ClipPath clipOp = {
43 SkIRect::MakeEmpty(), // Willie don't care. 43 SkIRect::MakeEmpty(), // Willie don't care.
44 path, 44 path,
45 SkRecords::RegionOpAndAA(op, doAntiAlias) 45 SkRecords::ClipOpAndAA(op, doAntiAlias)
46 }; 46 };
47 47
48 SkPathCounter counter; 48 SkPathCounter counter;
49 counter(clipOp); 49 counter(clipOp);
50 fNumSlowPaths += counter.fNumSlowPathsAndDashEffects; 50 fNumSlowPaths += counter.fNumSlowPathsAndDashEffects;
51 } 51 }
52 52
53 void SkPictureGpuAnalyzer::reset() { 53 void SkPictureGpuAnalyzer::reset() {
54 fNumSlowPaths = 0; 54 fNumSlowPaths = 0;
55 } 55 }
56 56
57 bool SkPictureGpuAnalyzer::suitableForGpuRasterization(const char** whyNot) cons t { 57 bool SkPictureGpuAnalyzer::suitableForGpuRasterization(const char** whyNot) cons t {
58 if(veto_predicate(fNumSlowPaths)) { 58 if(veto_predicate(fNumSlowPaths)) {
59 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; } 59 if (whyNot) { *whyNot = "Too many slow paths (either concave or dashed). "; }
60 return false; 60 return false;
61 } 61 }
62 return true; 62 return true;
63 } 63 }
64 64
65 #endif // SK_SUPPORT_GPU 65 #endif // SK_SUPPORT_GPU
OLDNEW
« no previous file with comments | « src/core/SkLiteRecorder.cpp ('k') | src/core/SkPictureFlat.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698