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 #include "cc/resources/bitmap_content_layer_updater.h" | 5 #include "cc/resources/bitmap_content_layer_updater.h" |
6 | 6 |
7 #include "cc/debug/devtools_instrumentation.h" | 7 #include "cc/debug/devtools_instrumentation.h" |
8 #include "cc/debug/rendering_stats_instrumentation.h" | 8 #include "cc/debug/rendering_stats_instrumentation.h" |
9 #include "cc/resources/layer_painter.h" | 9 #include "cc/resources/layer_painter.h" |
10 #include "cc/resources/prioritized_resource.h" | 10 #include "cc/resources/prioritized_resource.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 BitmapContentLayerUpdater::BitmapContentLayerUpdater( | 43 BitmapContentLayerUpdater::BitmapContentLayerUpdater( |
44 scoped_ptr<LayerPainter> painter, | 44 scoped_ptr<LayerPainter> painter, |
45 RenderingStatsInstrumentation* stats_instrumentation, | 45 RenderingStatsInstrumentation* stats_instrumentation, |
46 int layer_id) | 46 int layer_id) |
47 : ContentLayerUpdater(painter.Pass(), stats_instrumentation, layer_id) {} | 47 : ContentLayerUpdater(painter.Pass(), stats_instrumentation, layer_id) {} |
48 | 48 |
49 BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {} | 49 BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {} |
50 | 50 |
51 scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource( | 51 scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource( |
52 PrioritizedResourceManager* manager) { | 52 PrioritizedResourceManager* manager) { |
53 return scoped_ptr<LayerUpdater::Resource>( | 53 return make_scoped_ptr( |
54 new Resource(this, PrioritizedResource::Create(manager))); | 54 new Resource(this, PrioritizedResource::Create(manager))); |
55 } | 55 } |
56 | 56 |
57 void BitmapContentLayerUpdater::PrepareToUpdate(const gfx::Size& content_size, | 57 void BitmapContentLayerUpdater::PrepareToUpdate(const gfx::Size& content_size, |
58 const gfx::Rect& paint_rect, | 58 const gfx::Rect& paint_rect, |
59 const gfx::Size& tile_size, | 59 const gfx::Size& tile_size, |
60 float contents_width_scale, | 60 float contents_width_scale, |
61 float contents_height_scale) { | 61 float contents_height_scale) { |
62 if (canvas_size_ != paint_rect.size()) { | 62 if (canvas_size_ != paint_rect.size()) { |
63 devtools_instrumentation::ScopedLayerTask paint_setup( | 63 devtools_instrumentation::ScopedLayerTask paint_setup( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void BitmapContentLayerUpdater::SetOpaque(bool opaque) { | 106 void BitmapContentLayerUpdater::SetOpaque(bool opaque) { |
107 if (opaque != layer_is_opaque_) { | 107 if (opaque != layer_is_opaque_) { |
108 canvas_.clear(); | 108 canvas_.clear(); |
109 canvas_size_ = gfx::Size(); | 109 canvas_size_ = gfx::Size(); |
110 } | 110 } |
111 | 111 |
112 ContentLayerUpdater::SetOpaque(opaque); | 112 ContentLayerUpdater::SetOpaque(opaque); |
113 } | 113 } |
114 | 114 |
115 } // namespace cc | 115 } // namespace cc |
OLD | NEW |