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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 gfx::Point min_point_; | 107 gfx::Point min_point_; |
108 gfx::Point max_point_; | 108 gfx::Point max_point_; |
109 int current_x_; | 109 int current_x_; |
110 int current_y_; | 110 int current_y_; |
111 }; | 111 }; |
112 | 112 |
113 void EmitTraceSnapshot(); | 113 void EmitTraceSnapshot(); |
114 | 114 |
115 private: | 115 private: |
116 explicit Picture(gfx::Rect layer_rect); | 116 explicit Picture(gfx::Rect layer_rect); |
117 Picture(const base::Value*, bool* success); | |
118 // This constructor assumes SkPicture is already ref'd and transfers | 117 // This constructor assumes SkPicture is already ref'd and transfers |
119 // ownership to this picture. | 118 // ownership to this picture. |
120 Picture(const skia::RefPtr<SkPicture>&, | 119 Picture(const skia::RefPtr<SkPicture>&, |
121 gfx::Rect layer_rect, | 120 gfx::Rect layer_rect, |
122 gfx::Rect opaque_rect, | 121 gfx::Rect opaque_rect, |
123 const PixelRefMap& pixel_refs); | 122 const PixelRefMap& pixel_refs); |
| 123 // This constructor will call AdoptRef on the SkPicture. |
| 124 Picture(SkPicture*, |
| 125 gfx::Rect layer_rect, |
| 126 gfx::Rect opaque_rect); |
124 ~Picture(); | 127 ~Picture(); |
125 | 128 |
126 gfx::Rect layer_rect_; | 129 gfx::Rect layer_rect_; |
127 gfx::Rect opaque_rect_; | 130 gfx::Rect opaque_rect_; |
128 skia::RefPtr<SkPicture> picture_; | 131 skia::RefPtr<SkPicture> picture_; |
129 | 132 |
130 typedef std::vector<scoped_refptr<Picture> > PictureVector; | 133 typedef std::vector<scoped_refptr<Picture> > PictureVector; |
131 PictureVector clones_; | 134 PictureVector clones_; |
132 | 135 |
133 PixelRefMap pixel_refs_; | 136 PixelRefMap pixel_refs_; |
134 gfx::Point min_pixel_cell_; | 137 gfx::Point min_pixel_cell_; |
135 gfx::Point max_pixel_cell_; | 138 gfx::Point max_pixel_cell_; |
136 gfx::Size cell_size_; | 139 gfx::Size cell_size_; |
137 | 140 |
138 scoped_ptr<base::debug::ConvertableToTraceFormat> | 141 scoped_ptr<base::debug::ConvertableToTraceFormat> |
139 AsTraceableRasterData(gfx::Rect rect, float scale); | 142 AsTraceableRasterData(gfx::Rect rect, float scale); |
140 | 143 |
141 friend class base::RefCountedThreadSafe<Picture>; | 144 friend class base::RefCountedThreadSafe<Picture>; |
142 friend class PixelRefIterator; | 145 friend class PixelRefIterator; |
143 DISALLOW_COPY_AND_ASSIGN(Picture); | 146 DISALLOW_COPY_AND_ASSIGN(Picture); |
144 }; | 147 }; |
145 | 148 |
146 } // namespace cc | 149 } // namespace cc |
147 | 150 |
148 #endif // CC_RESOURCES_PICTURE_H_ | 151 #endif // CC_RESOURCES_PICTURE_H_ |
OLD | NEW |