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

Side by Side Diff: skia/ext/analysis_canvas.h

Issue 416333003: Revert of skia/ext: Early out from analysis when we have more than 1 draw op. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | skia/ext/analysis_canvas.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_ 5 #ifndef SKIA_EXT_ANALYSIS_CANVAS_H_
6 #define SKIA_EXT_ANALYSIS_CANVAS_H_ 6 #define SKIA_EXT_ANALYSIS_CANVAS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkPicture.h" 10 #include "third_party/skia/include/core/SkPicture.h"
11 11
12 namespace skia { 12 namespace skia {
13 13
14 // Does not render anything, but gathers statistics about a region 14 // Does not render anything, but gathers statistics about a region
15 // (specified as a clip rectangle) of an SkPicture as the picture is 15 // (specified as a clip rectangle) of an SkPicture as the picture is
16 // played back through it. 16 // played back through it.
17 // To use: play a picture into the canvas, and then check result. 17 // To use: play a picture into the canvas, and then check result.
18 class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback { 18 class SK_API AnalysisCanvas : public SkCanvas, public SkDrawPictureCallback {
19 public: 19 public:
20 AnalysisCanvas(int width, int height); 20 AnalysisCanvas(int width, int height);
21 virtual ~AnalysisCanvas(); 21 virtual ~AnalysisCanvas();
22 22
23 // Returns true when a SkColor can be used to represent result. 23 // Returns true when a SkColor can be used to represent result.
24 bool GetColorIfSolid(SkColor* color) const; 24 bool GetColorIfSolid(SkColor* color) const;
25 bool HasText() const;
25 26
26 void SetForceNotSolid(bool flag); 27 void SetForceNotSolid(bool flag);
27 void SetForceNotTransparent(bool flag); 28 void SetForceNotTransparent(bool flag);
28 29
29 // SkDrawPictureCallback override. 30 // SkDrawPictureCallback override.
30 virtual bool abortDrawing() OVERRIDE; 31 virtual bool abortDrawing() OVERRIDE;
31 32
32 // SkCanvas overrides. 33 // SkCanvas overrides.
33 virtual void clear(SkColor) OVERRIDE; 34 virtual void clear(SkColor) OVERRIDE;
34 virtual void drawPaint(const SkPaint& paint) OVERRIDE; 35 virtual void drawPaint(const SkPaint& paint) OVERRIDE;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 114
114 int saved_stack_size_; 115 int saved_stack_size_;
115 int force_not_solid_stack_level_; 116 int force_not_solid_stack_level_;
116 int force_not_transparent_stack_level_; 117 int force_not_transparent_stack_level_;
117 118
118 bool is_forced_not_solid_; 119 bool is_forced_not_solid_;
119 bool is_forced_not_transparent_; 120 bool is_forced_not_transparent_;
120 bool is_solid_color_; 121 bool is_solid_color_;
121 SkColor color_; 122 SkColor color_;
122 bool is_transparent_; 123 bool is_transparent_;
123 int draw_op_count_; 124 bool has_text_;
124 }; 125 };
125 126
126 } // namespace skia 127 } // namespace skia
127 128
128 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ 129 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_
129 130
OLDNEW
« no previous file with comments | « no previous file | skia/ext/analysis_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698