OLD | NEW |
---|---|
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 <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... | |
28 typedef std::list<skia::LazyPixelRef*> LazyPixelRefList; | 28 typedef std::list<skia::LazyPixelRef*> LazyPixelRefList; |
29 | 29 |
30 AnalysisCanvas(AnalysisDevice*); | 30 AnalysisCanvas(AnalysisDevice*); |
31 virtual ~AnalysisCanvas(); | 31 virtual ~AnalysisCanvas(); |
32 | 32 |
33 // Returns true if the estimated cost of drawing is below an | 33 // Returns true if the estimated cost of drawing is below an |
34 // arbitrary threshold. | 34 // arbitrary threshold. |
35 bool isCheap() const; | 35 bool isCheap() const; |
36 bool getColorIfSolid(SkColor* color) const; | 36 bool getColorIfSolid(SkColor* color) const; |
37 bool isTransparent() const; | 37 bool isTransparent() const; |
38 bool hasText() const; | |
enne (OOO)
2013/04/05 21:39:36
Is this file not in Chromium style?
alokp
2013/04/05 22:50:11
We seem to be following skia style in this file.
enne (OOO)
2013/04/05 22:58:12
Except hasText_ is not Skia style? At any rate, t
| |
38 void consumeLazyPixelRefs(LazyPixelRefList* pixelRefs); | 39 void consumeLazyPixelRefs(LazyPixelRefList* pixelRefs); |
39 | 40 |
40 // Returns the estimated cost of drawing, in arbitrary units. | 41 // Returns the estimated cost of drawing, in arbitrary units. |
41 int getEstimatedCost() const; | 42 int getEstimatedCost() const; |
42 | 43 |
43 virtual bool clipRect(const SkRect& rect, | 44 virtual bool clipRect(const SkRect& rect, |
44 SkRegion::Op op = SkRegion::kIntersect_Op, | 45 SkRegion::Op op = SkRegion::kIntersect_Op, |
45 bool doAntiAlias = false) OVERRIDE; | 46 bool doAntiAlias = false) OVERRIDE; |
46 virtual bool clipPath(const SkPath& path, | 47 virtual bool clipPath(const SkPath& path, |
47 SkRegion::Op op = SkRegion::kIntersect_Op, | 48 SkRegion::Op op = SkRegion::kIntersect_Op, |
(...skipping 21 matching lines...) Expand all Loading... | |
69 public: | 70 public: |
70 typedef std::list<skia::LazyPixelRef*> LazyPixelRefList; | 71 typedef std::list<skia::LazyPixelRef*> LazyPixelRefList; |
71 typedef base::hash_set<uint32_t> IdSet; | 72 typedef base::hash_set<uint32_t> IdSet; |
72 | 73 |
73 AnalysisDevice(const SkBitmap& bm); | 74 AnalysisDevice(const SkBitmap& bm); |
74 virtual ~AnalysisDevice(); | 75 virtual ~AnalysisDevice(); |
75 | 76 |
76 int getEstimatedCost() const; | 77 int getEstimatedCost() const; |
77 bool getColorIfSolid(SkColor* color) const; | 78 bool getColorIfSolid(SkColor* color) const; |
78 bool isTransparent() const; | 79 bool isTransparent() const; |
80 bool hasText() const; | |
79 void consumeLazyPixelRefs(LazyPixelRefList* pixelRefs); | 81 void consumeLazyPixelRefs(LazyPixelRefList* pixelRefs); |
80 | 82 |
81 void setForceNotSolid(bool flag); | 83 void setForceNotSolid(bool flag); |
82 void setForceNotTransparent(bool flag); | 84 void setForceNotTransparent(bool flag); |
83 | 85 |
84 protected: | 86 protected: |
85 virtual void clear(SkColor color) OVERRIDE; | 87 virtual void clear(SkColor color) OVERRIDE; |
86 virtual void drawPaint(const SkDraw&, const SkPaint& paint) OVERRIDE; | 88 virtual void drawPaint(const SkDraw&, const SkPaint& paint) OVERRIDE; |
87 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | 89 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
88 size_t count, const SkPoint[], | 90 size_t count, const SkPoint[], |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 | 139 |
138 void addPixelRefIfLazy(SkPixelRef* pixelRef); | 140 void addPixelRefIfLazy(SkPixelRef* pixelRef); |
139 void addBitmap(const SkBitmap& bitmap); | 141 void addBitmap(const SkBitmap& bitmap); |
140 void addBitmapFromPaint(const SkPaint& paint); | 142 void addBitmapFromPaint(const SkPaint& paint); |
141 | 143 |
142 bool isForcedNotSolid_; | 144 bool isForcedNotSolid_; |
143 bool isForcedNotTransparent_; | 145 bool isForcedNotTransparent_; |
144 bool isSolidColor_; | 146 bool isSolidColor_; |
145 SkColor color_; | 147 SkColor color_; |
146 bool isTransparent_; | 148 bool isTransparent_; |
149 bool hasText_; | |
147 IdSet existingPixelRefIDs_; | 150 IdSet existingPixelRefIDs_; |
148 LazyPixelRefList lazyPixelRefs_; | 151 LazyPixelRefList lazyPixelRefs_; |
149 }; | 152 }; |
150 | 153 |
151 } // namespace skia | 154 } // namespace skia |
152 | 155 |
153 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ | 156 #endif // SKIA_EXT_ANALYSIS_CANVAS_H_ |
154 | 157 |
OLD | NEW |