Chromium Code Reviews| 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 <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 void Raster(SkCanvas* canvas, | 53 void Raster(SkCanvas* canvas, |
| 54 gfx::Rect content_rect, | 54 gfx::Rect content_rect, |
| 55 float contents_scale, | 55 float contents_scale, |
| 56 bool enable_lcd_text); | 56 bool enable_lcd_text); |
| 57 | 57 |
| 58 void GatherPixelRefs( | 58 void GatherPixelRefs( |
| 59 const gfx::Rect& layer_rect, | 59 const gfx::Rect& layer_rect, |
| 60 std::list<skia::LazyPixelRef*>& pixel_ref_list); | 60 std::list<skia::LazyPixelRef*>& pixel_ref_list); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 struct PositionPixelRefs { | |
| 64 gfx::Rect rect; | |
| 65 std::list<skia::LazyPixelRef*> pixel_refs; | |
| 66 }; | |
| 67 typedef std::vector<PositionPixelRefs> PositionPixelRefsVector; | |
|
reveman
2013/04/16 18:38:35
how about using:
base::hash_map<std::pair<int, int
enne (OOO)
2013/04/16 22:03:36
For a recorded tile, you mean? I think the origin
reveman
2013/04/17 00:25:28
we're trying to get the pixel refs for a playback
| |
| 68 | |
| 63 explicit Picture(gfx::Rect layer_rect); | 69 explicit Picture(gfx::Rect layer_rect); |
| 64 // This constructor assumes SkPicture is already ref'd and transfers | 70 // This constructor assumes SkPicture is already ref'd and transfers |
| 65 // ownership to this picture. | 71 // ownership to this picture. |
| 66 Picture(const skia::RefPtr<SkPicture>&, | 72 Picture(const skia::RefPtr<SkPicture>&, |
| 67 gfx::Rect layer_rect, | 73 gfx::Rect layer_rect, |
| 68 gfx::Rect opaque_rect); | 74 gfx::Rect opaque_rect, |
| 75 const PositionPixelRefsVector& lazy_pixel_refs); | |
| 69 ~Picture(); | 76 ~Picture(); |
| 70 | 77 |
| 78 void GatherPixelRefsFromSkia( | |
| 79 const gfx::Rect& layer_rect, | |
| 80 std::list<skia::LazyPixelRef*>& pixel_ref_list); | |
| 81 void GatherAllPixelRefs(); | |
| 82 | |
| 71 gfx::Rect layer_rect_; | 83 gfx::Rect layer_rect_; |
| 72 gfx::Rect opaque_rect_; | 84 gfx::Rect opaque_rect_; |
| 73 skia::RefPtr<SkPicture> picture_; | 85 skia::RefPtr<SkPicture> picture_; |
| 74 | 86 |
| 75 typedef std::vector<scoped_refptr<Picture> > PictureVector; | 87 typedef std::vector<scoped_refptr<Picture> > PictureVector; |
| 76 PictureVector clones_; | 88 PictureVector clones_; |
| 77 | 89 |
| 90 PositionPixelRefsVector lazy_pixel_refs_; | |
|
enne (OOO)
2013/04/16 22:03:36
These are safe to store using raw pointers because
| |
| 91 | |
| 78 friend class base::RefCountedThreadSafe<Picture>; | 92 friend class base::RefCountedThreadSafe<Picture>; |
| 79 DISALLOW_COPY_AND_ASSIGN(Picture); | 93 DISALLOW_COPY_AND_ASSIGN(Picture); |
| 80 }; | 94 }; |
| 81 | 95 |
| 82 } // namespace cc | 96 } // namespace cc |
| 83 | 97 |
| 84 #endif // CC_RESOURCES_PICTURE_H_ | 98 #endif // CC_RESOURCES_PICTURE_H_ |
| OLD | NEW |