| 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/skpicture_content_layer_updater.h" | 5 #include "cc/resources/skpicture_content_layer_updater.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/resources/layer_painter.h" | 8 #include "cc/resources/layer_painter.h" |
| 9 #include "cc/resources/prioritized_resource.h" | 9 #include "cc/resources/prioritized_resource.h" |
| 10 #include "cc/resources/resource_update_queue.h" | 10 #include "cc/resources/resource_update_queue.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 void SkPictureContentLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, | 22 void SkPictureContentLayerUpdater::Resource::Update(ResourceUpdateQueue* queue, |
| 23 gfx::Rect source_rect, | 23 gfx::Rect source_rect, |
| 24 gfx::Vector2d dest_offset, | 24 gfx::Vector2d dest_offset, |
| 25 bool partial_update, | 25 bool partial_update, |
| 26 RenderingStats*) { | 26 RenderingStats*) { |
| 27 updater_->UpdateTexture( | 27 updater_->UpdateTexture( |
| 28 queue, texture(), source_rect, dest_offset, partial_update); | 28 queue, texture(), source_rect, dest_offset, partial_update); |
| 29 } | 29 } |
| 30 | 30 |
| 31 SkPictureContentLayerUpdater::SkPictureContentLayerUpdater( | 31 SkPictureContentLayerUpdater::SkPictureContentLayerUpdater( |
| 32 scoped_ptr<LayerPainter> painter) | 32 scoped_ptr<LayerPainter> painter, |
| 33 : ContentLayerUpdater(painter.Pass()), layer_is_opaque_(false) {} | 33 RenderingStatsInstrumentation* stats_instrumentation) |
| 34 : ContentLayerUpdater(painter.Pass(), stats_instrumentation), |
| 35 layer_is_opaque_(false) {} |
| 34 | 36 |
| 35 SkPictureContentLayerUpdater::~SkPictureContentLayerUpdater() {} | 37 SkPictureContentLayerUpdater::~SkPictureContentLayerUpdater() {} |
| 36 | 38 |
| 37 scoped_refptr<SkPictureContentLayerUpdater> | 39 scoped_refptr<SkPictureContentLayerUpdater> |
| 38 SkPictureContentLayerUpdater::Create(scoped_ptr<LayerPainter> painter) { | 40 SkPictureContentLayerUpdater::Create( |
| 39 return make_scoped_refptr(new SkPictureContentLayerUpdater(painter.Pass())); | 41 scoped_ptr<LayerPainter> painter, |
| 42 RenderingStatsInstrumentation* stats_instrumentation) { |
| 43 return make_scoped_refptr( |
| 44 new SkPictureContentLayerUpdater(painter.Pass(), stats_instrumentation)); |
| 40 } | 45 } |
| 41 | 46 |
| 42 scoped_ptr<LayerUpdater::Resource> SkPictureContentLayerUpdater::CreateResource( | 47 scoped_ptr<LayerUpdater::Resource> SkPictureContentLayerUpdater::CreateResource( |
| 43 PrioritizedResourceManager* manager) { | 48 PrioritizedResourceManager* manager) { |
| 44 return scoped_ptr<LayerUpdater::Resource>( | 49 return scoped_ptr<LayerUpdater::Resource>( |
| 45 new Resource(this, PrioritizedResource::Create(manager))); | 50 new Resource(this, PrioritizedResource::Create(manager))); |
| 46 } | 51 } |
| 47 | 52 |
| 48 void SkPictureContentLayerUpdater::PrepareToUpdate( | 53 void SkPictureContentLayerUpdater::PrepareToUpdate( |
| 49 gfx::Rect content_rect, | 54 gfx::Rect content_rect, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 queue->AppendPartialUpload(upload); | 84 queue->AppendPartialUpload(upload); |
| 80 else | 85 else |
| 81 queue->AppendFullUpload(upload); | 86 queue->AppendFullUpload(upload); |
| 82 } | 87 } |
| 83 | 88 |
| 84 void SkPictureContentLayerUpdater::SetOpaque(bool opaque) { | 89 void SkPictureContentLayerUpdater::SetOpaque(bool opaque) { |
| 85 layer_is_opaque_ = opaque; | 90 layer_is_opaque_ = opaque; |
| 86 } | 91 } |
| 87 | 92 |
| 88 } // namespace cc | 93 } // namespace cc |
| OLD | NEW |