| 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_CONTENT_LAYER_UPDATER_H_ | 5 #ifndef CC_RESOURCES_CONTENT_LAYER_UPDATER_H_ |
| 6 #define CC_RESOURCES_CONTENT_LAYER_UPDATER_H_ | 6 #define CC_RESOURCES_CONTENT_LAYER_UPDATER_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/resources/layer_updater.h" | 9 #include "cc/resources/layer_updater.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 | 11 |
| 12 class SkCanvas; | 12 class SkCanvas; |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 class LayerPainter; | 16 class LayerPainter; |
| 17 class RenderingStatsInstrumentation; |
| 17 | 18 |
| 18 // Base class for BitmapContentLayerUpdater and | 19 // Base class for BitmapContentLayerUpdater and |
| 19 // SkPictureContentLayerUpdater that reduces code duplication between | 20 // SkPictureContentLayerUpdater that reduces code duplication between |
| 20 // their respective PaintContents implementations. | 21 // their respective PaintContents implementations. |
| 21 class CC_EXPORT ContentLayerUpdater : public LayerUpdater { | 22 class CC_EXPORT ContentLayerUpdater : public LayerUpdater { |
| 22 protected: | 23 protected: |
| 23 explicit ContentLayerUpdater(scoped_ptr<LayerPainter> painter); | 24 ContentLayerUpdater(scoped_ptr<LayerPainter> painter, |
| 25 RenderingStatsInstrumentation* stats_instrumentation); |
| 24 virtual ~ContentLayerUpdater(); | 26 virtual ~ContentLayerUpdater(); |
| 25 | 27 |
| 26 void PaintContents(SkCanvas* canvas, | 28 void PaintContents(SkCanvas* canvas, |
| 27 gfx::Rect content_rect, | 29 gfx::Rect content_rect, |
| 28 float contents_width_scale, | 30 float contents_width_scale, |
| 29 float contents_height_scale, | 31 float contents_height_scale, |
| 30 gfx::Rect* resulting_opaque_rect, | 32 gfx::Rect* resulting_opaque_rect, |
| 31 RenderingStats* stats); | 33 RenderingStats* stats); |
| 32 gfx::Rect content_rect() const { return content_rect_; } | 34 gfx::Rect content_rect() const { return content_rect_; } |
| 33 | 35 |
| 36 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 37 |
| 34 private: | 38 private: |
| 35 gfx::Rect content_rect_; | 39 gfx::Rect content_rect_; |
| 36 scoped_ptr<LayerPainter> painter_; | 40 scoped_ptr<LayerPainter> painter_; |
| 37 | 41 |
| 38 DISALLOW_COPY_AND_ASSIGN(ContentLayerUpdater); | 42 DISALLOW_COPY_AND_ASSIGN(ContentLayerUpdater); |
| 39 }; | 43 }; |
| 40 | 44 |
| 41 } // namespace cc | 45 } // namespace cc |
| 42 | 46 |
| 43 #endif // CC_RESOURCES_CONTENT_LAYER_UPDATER_H_ | 47 #endif // CC_RESOURCES_CONTENT_LAYER_UPDATER_H_ |
| OLD | NEW |