OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
6 #define CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
7 | 7 |
8 #include "cc/resources/content_layer_updater.h" | 8 #include "cc/resources/content_layer_updater.h" |
9 #include "third_party/skia/include/core/SkPicture.h" | 9 #include "third_party/skia/include/core/SkPicture.h" |
10 | 10 |
11 class SkCanvas; | 11 class SkCanvas; |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class LayerPainter; | 15 class LayerPainter; |
16 | 16 |
17 // This class records the content_rect into an SkPicture. Subclass provides | 17 // This class records the content_rect into an SkPicture. Subclass provides |
18 // SkCanvas to DrawPicture() for tile updating based on this recorded picture. | 18 // SkCanvas to DrawPicture() for tile updating based on this recorded picture. |
19 class SkPictureContentLayerUpdater : public ContentLayerUpdater { | 19 class SkPictureContentLayerUpdater : public ContentLayerUpdater { |
20 protected: | 20 protected: |
21 SkPictureContentLayerUpdater( | 21 SkPictureContentLayerUpdater( |
22 scoped_ptr<LayerPainter> painter, | 22 scoped_ptr<LayerPainter> painter, |
23 RenderingStatsInstrumentation* stats_instrumentation, | 23 RenderingStatsInstrumentation* stats_instrumentation, |
24 int layer_id); | 24 int layer_id); |
25 virtual ~SkPictureContentLayerUpdater(); | 25 virtual ~SkPictureContentLayerUpdater(); |
26 | 26 |
27 virtual void PrepareToUpdate(const gfx::Rect& content_rect, | 27 virtual void PrepareToUpdate(const gfx::Rect& content_rect, |
28 gfx::Size tile_size, | 28 const gfx::Size& tile_size, |
29 float contents_width_scale, | 29 float contents_width_scale, |
30 float contents_height_scale, | 30 float contents_height_scale, |
31 gfx::Rect* resulting_opaque_rect) OVERRIDE; | 31 gfx::Rect* resulting_opaque_rect) OVERRIDE; |
32 void DrawPicture(SkCanvas* canvas); | 32 void DrawPicture(SkCanvas* canvas); |
33 | 33 |
34 private: | 34 private: |
35 // Recording canvas. | 35 // Recording canvas. |
36 SkPicture picture_; | 36 SkPicture picture_; |
37 | 37 |
38 DISALLOW_COPY_AND_ASSIGN(SkPictureContentLayerUpdater); | 38 DISALLOW_COPY_AND_ASSIGN(SkPictureContentLayerUpdater); |
39 }; | 39 }; |
40 | 40 |
41 } // namespace cc | 41 } // namespace cc |
42 | 42 |
43 #endif // CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ | 43 #endif // CC_RESOURCES_SKPICTURE_CONTENT_LAYER_UPDATER_H_ |
OLD | NEW |