| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 RECORD_WITH_PAINTING_DISABLED, | 52 RECORD_WITH_PAINTING_DISABLED, |
| 53 RECORD_WITH_SKRECORD, | 53 RECORD_WITH_SKRECORD, |
| 54 RECORDING_MODE_COUNT, // Must be the last entry. | 54 RECORDING_MODE_COUNT, // Must be the last entry. |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 static scoped_refptr<Picture> Create( | 57 static scoped_refptr<Picture> Create( |
| 58 const gfx::Rect& layer_rect, | 58 const gfx::Rect& layer_rect, |
| 59 ContentLayerClient* client, | 59 ContentLayerClient* client, |
| 60 const SkTileGridFactory::TileGridInfo& tile_grid_info, | 60 const SkTileGridFactory::TileGridInfo& tile_grid_info, |
| 61 bool gather_pixels_refs, | 61 bool gather_pixels_refs, |
| 62 bool can_use_lcd_text, |
| 62 int num_raster_threads, | 63 int num_raster_threads, |
| 63 RecordingMode recording_mode); | 64 RecordingMode recording_mode); |
| 64 static scoped_refptr<Picture> CreateFromValue(const base::Value* value); | 65 static scoped_refptr<Picture> CreateFromValue(const base::Value* value); |
| 65 static scoped_refptr<Picture> CreateFromSkpValue(const base::Value* value); | 66 static scoped_refptr<Picture> CreateFromSkpValue(const base::Value* value); |
| 66 | 67 |
| 67 gfx::Rect LayerRect() const { return layer_rect_; } | 68 gfx::Rect LayerRect() const { return layer_rect_; } |
| 68 gfx::Rect OpaqueRect() const { return opaque_rect_; } | 69 gfx::Rect OpaqueRect() const { return opaque_rect_; } |
| 69 | 70 |
| 70 // Get thread-safe clone for rasterizing with on a specific thread. | 71 // Get thread-safe clone for rasterizing with on a specific thread. |
| 71 Picture* GetCloneForDrawingOnThread(unsigned thread_index); | 72 Picture* GetCloneForDrawingOnThread(unsigned thread_index); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 const gfx::Rect& opaque_rect); | 146 const gfx::Rect& opaque_rect); |
| 146 ~Picture(); | 147 ~Picture(); |
| 147 | 148 |
| 148 // Make thread-safe clones for rasterizing with. | 149 // Make thread-safe clones for rasterizing with. |
| 149 void CloneForDrawing(int num_threads); | 150 void CloneForDrawing(int num_threads); |
| 150 | 151 |
| 151 // Record a paint operation. To be able to safely use this SkPicture for | 152 // Record a paint operation. To be able to safely use this SkPicture for |
| 152 // playback on a different thread this can only be called once. | 153 // playback on a different thread this can only be called once. |
| 153 void Record(ContentLayerClient* client, | 154 void Record(ContentLayerClient* client, |
| 154 const SkTileGridFactory::TileGridInfo& tile_grid_info, | 155 const SkTileGridFactory::TileGridInfo& tile_grid_info, |
| 156 bool can_use_lcd_text, |
| 155 RecordingMode recording_mode); | 157 RecordingMode recording_mode); |
| 156 | 158 |
| 157 // Gather pixel refs from recording. | 159 // Gather pixel refs from recording. |
| 158 void GatherPixelRefs(const SkTileGridFactory::TileGridInfo& tile_grid_info); | 160 void GatherPixelRefs(const SkTileGridFactory::TileGridInfo& tile_grid_info); |
| 159 | 161 |
| 160 gfx::Rect layer_rect_; | 162 gfx::Rect layer_rect_; |
| 161 gfx::Rect opaque_rect_; | 163 gfx::Rect opaque_rect_; |
| 162 skia::RefPtr<SkPicture> picture_; | 164 skia::RefPtr<SkPicture> picture_; |
| 163 scoped_ptr<const EXPERIMENTAL::SkPlayback> playback_; | 165 scoped_ptr<const EXPERIMENTAL::SkPlayback> playback_; |
| 164 | 166 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 178 base::ThreadChecker raster_thread_checker_; | 180 base::ThreadChecker raster_thread_checker_; |
| 179 | 181 |
| 180 friend class base::RefCountedThreadSafe<Picture>; | 182 friend class base::RefCountedThreadSafe<Picture>; |
| 181 friend class PixelRefIterator; | 183 friend class PixelRefIterator; |
| 182 DISALLOW_COPY_AND_ASSIGN(Picture); | 184 DISALLOW_COPY_AND_ASSIGN(Picture); |
| 183 }; | 185 }; |
| 184 | 186 |
| 185 } // namespace cc | 187 } // namespace cc |
| 186 | 188 |
| 187 #endif // CC_RESOURCES_PICTURE_H_ | 189 #endif // CC_RESOURCES_PICTURE_H_ |
| OLD | NEW |