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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 gfx::Rect LayerRect() const { return layer_rect_; } | 56 gfx::Rect LayerRect() const { return layer_rect_; } |
57 gfx::Rect OpaqueRect() const { return opaque_rect_; } | 57 gfx::Rect OpaqueRect() const { return opaque_rect_; } |
58 | 58 |
59 // Get thread-safe clone for rasterizing with on a specific thread. | 59 // Get thread-safe clone for rasterizing with on a specific thread. |
60 Picture* GetCloneForDrawingOnThread(unsigned thread_index); | 60 Picture* GetCloneForDrawingOnThread(unsigned thread_index); |
61 | 61 |
62 // Has Record() been called yet? | 62 // Has Record() been called yet? |
63 bool HasRecording() const { return picture_.get() != NULL; } | 63 bool HasRecording() const { return picture_.get() != NULL; } |
64 | 64 |
| 65 bool IsSuitableForGpuRasterization() const; |
| 66 |
65 // Apply this scale and raster the negated region into the canvas. See comment | 67 // Apply this scale and raster the negated region into the canvas. See comment |
66 // in PicturePileImpl::RasterCommon for explanation on negated content region. | 68 // in PicturePileImpl::RasterCommon for explanation on negated content region. |
67 int Raster(SkCanvas* canvas, | 69 int Raster(SkCanvas* canvas, |
68 SkDrawPictureCallback* callback, | 70 SkDrawPictureCallback* callback, |
69 const Region& negated_content_region, | 71 const Region& negated_content_region, |
70 float contents_scale); | 72 float contents_scale); |
71 | 73 |
72 // Draw the picture directly into the given canvas, without applying any | 74 // Draw the picture directly into the given canvas, without applying any |
73 // clip/scale/layer transformations. | 75 // clip/scale/layer transformations. |
74 void Replay(SkCanvas* canvas); | 76 void Replay(SkCanvas* canvas); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 base::ThreadChecker raster_thread_checker_; | 163 base::ThreadChecker raster_thread_checker_; |
162 | 164 |
163 friend class base::RefCountedThreadSafe<Picture>; | 165 friend class base::RefCountedThreadSafe<Picture>; |
164 friend class PixelRefIterator; | 166 friend class PixelRefIterator; |
165 DISALLOW_COPY_AND_ASSIGN(Picture); | 167 DISALLOW_COPY_AND_ASSIGN(Picture); |
166 }; | 168 }; |
167 | 169 |
168 } // namespace cc | 170 } // namespace cc |
169 | 171 |
170 #endif // CC_RESOURCES_PICTURE_H_ | 172 #endif // CC_RESOURCES_PICTURE_H_ |
OLD | NEW |