OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_RESOURCES_PICTURE_H_ | 5 #ifndef CC_RESOURCES_PICTURE_H_ |
6 #define CC_RESOURCES_PICTURE_H_ | 6 #define CC_RESOURCES_PICTURE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 gfx::Rect LayerRect() const { return layer_rect_; } | 67 gfx::Rect LayerRect() const { return layer_rect_; } |
68 gfx::Rect OpaqueRect() const { return opaque_rect_; } | 68 gfx::Rect OpaqueRect() const { return opaque_rect_; } |
69 | 69 |
70 // Get thread-safe clone for rasterizing with on a specific thread. | 70 // Get thread-safe clone for rasterizing with on a specific thread. |
71 Picture* GetCloneForDrawingOnThread(unsigned thread_index); | 71 Picture* GetCloneForDrawingOnThread(unsigned thread_index); |
72 | 72 |
73 // Has Record() been called yet? | 73 // Has Record() been called yet? |
74 bool HasRecording() const { return picture_.get() != NULL; } | 74 bool HasRecording() const { return picture_.get() != NULL; } |
75 | 75 |
76 bool IsSuitableForGpuRasterization() const; | 76 bool IsSuitableForGpuRasterization() const; |
77 int GetApproximateOpCount() const; | |
enne (OOO)
2014/08/20 18:19:26
style nit: No need for "get" in a function name.
hendrikw
2014/08/20 20:46:55
vmpstr suggested the name :) I think Get improves
| |
77 | 78 |
78 // Apply this scale and raster the negated region into the canvas. | 79 // Apply this scale and raster the negated region into the canvas. |
79 // |negated_content_region| specifies the region to be clipped out of the | 80 // |negated_content_region| specifies the region to be clipped out of the |
80 // raster operation, i.e., the parts of the canvas which will not get drawn | 81 // raster operation, i.e., the parts of the canvas which will not get drawn |
81 // to. | 82 // to. |
82 int Raster(SkCanvas* canvas, | 83 int Raster(SkCanvas* canvas, |
83 SkDrawPictureCallback* callback, | 84 SkDrawPictureCallback* callback, |
84 const Region& negated_content_region, | 85 const Region& negated_content_region, |
85 float contents_scale); | 86 float contents_scale); |
86 | 87 |
88 void RasterForAnalysis(SkCanvas* canvas); | |
89 | |
87 // Draw the picture directly into the given canvas, without applying any | 90 // Draw the picture directly into the given canvas, without applying any |
88 // clip/scale/layer transformations. | 91 // clip/scale/layer transformations. |
89 void Replay(SkCanvas* canvas); | 92 void Replay(SkCanvas* canvas); |
90 | 93 |
91 scoped_ptr<base::Value> AsValue() const; | 94 scoped_ptr<base::Value> AsValue() const; |
92 | 95 |
93 // This iterator imprecisely returns the set of pixel refs that are needed to | 96 // This iterator imprecisely returns the set of pixel refs that are needed to |
94 // raster this layer rect from this picture. Internally, pixel refs are | 97 // raster this layer rect from this picture. Internally, pixel refs are |
95 // clumped into tile grid buckets, so there may be false positives. | 98 // clumped into tile grid buckets, so there may be false positives. |
96 class CC_EXPORT PixelRefIterator { | 99 class CC_EXPORT PixelRefIterator { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 base::ThreadChecker raster_thread_checker_; | 181 base::ThreadChecker raster_thread_checker_; |
179 | 182 |
180 friend class base::RefCountedThreadSafe<Picture>; | 183 friend class base::RefCountedThreadSafe<Picture>; |
181 friend class PixelRefIterator; | 184 friend class PixelRefIterator; |
182 DISALLOW_COPY_AND_ASSIGN(Picture); | 185 DISALLOW_COPY_AND_ASSIGN(Picture); |
183 }; | 186 }; |
184 | 187 |
185 } // namespace cc | 188 } // namespace cc |
186 | 189 |
187 #endif // CC_RESOURCES_PICTURE_H_ | 190 #endif // CC_RESOURCES_PICTURE_H_ |
OLD | NEW |