| 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_PICTURE_H_ | 5 #ifndef CC_PICTURE_H_ |
| 6 #define CC_PICTURE_H_ | 6 #define CC_PICTURE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 // Has Record() been called yet? | 39 // Has Record() been called yet? |
| 40 bool HasRecording() const { return picture_.get() != NULL; } | 40 bool HasRecording() const { return picture_.get() != NULL; } |
| 41 | 41 |
| 42 // Apply this contents scale and raster the content rect into the canvas. | 42 // Apply this contents scale and raster the content rect into the canvas. |
| 43 void Raster(SkCanvas* canvas, gfx::Rect content_rect, float contents_scale); | 43 void Raster(SkCanvas* canvas, gfx::Rect content_rect, float contents_scale); |
| 44 | 44 |
| 45 // Estimate the cost of rasterizing. To predict the cost of a particular | 45 // Estimate the cost of rasterizing. To predict the cost of a particular |
| 46 // call to Raster(), pass this the bounds of the canvas that will | 46 // call to Raster(), pass this the bounds of the canvas that will |
| 47 // be rastered into. | 47 // be rastered into. |
| 48 bool IsCheapInRect(const gfx::Rect& layer_rect); | 48 bool IsCheapInRect(const gfx::Rect& layer_rect) const; |
| 49 | 49 |
| 50 void GatherPixelRefs( | 50 void GatherPixelRefs( |
| 51 const gfx::Rect& layer_rect, | 51 const gfx::Rect& layer_rect, |
| 52 std::list<skia::LazyPixelRef*>& pixel_ref_list); | 52 std::list<skia::LazyPixelRef*>& pixel_ref_list); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 Picture(gfx::Rect layer_rect); | 55 Picture(gfx::Rect layer_rect); |
| 56 // This constructor assumes SkPicture is already ref'd and transfers | 56 // This constructor assumes SkPicture is already ref'd and transfers |
| 57 // ownership to this picture. | 57 // ownership to this picture. |
| 58 Picture(const skia::RefPtr<SkPicture>&, | 58 Picture(const skia::RefPtr<SkPicture>&, |
| 59 gfx::Rect layer_rect, | 59 gfx::Rect layer_rect, |
| 60 gfx::Rect opaque_rect); | 60 gfx::Rect opaque_rect); |
| 61 ~Picture(); | 61 ~Picture(); |
| 62 | 62 |
| 63 gfx::Rect layer_rect_; | 63 gfx::Rect layer_rect_; |
| 64 gfx::Rect opaque_rect_; | 64 gfx::Rect opaque_rect_; |
| 65 skia::RefPtr<SkPicture> picture_; | 65 skia::RefPtr<SkPicture> picture_; |
| 66 | 66 |
| 67 friend class base::RefCountedThreadSafe<Picture>; | 67 friend class base::RefCountedThreadSafe<Picture>; |
| 68 DISALLOW_COPY_AND_ASSIGN(Picture); | 68 DISALLOW_COPY_AND_ASSIGN(Picture); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace cc | 71 } // namespace cc |
| 72 | 72 |
| 73 #endif // CC_PICTURE_H_ | 73 #endif // CC_PICTURE_H_ |
| OLD | NEW |