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