Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
|
danakj
2014/01/08 17:49:59
We don't update the year in files. We only use the
enne (OOO)
2014/01/08 17:51:45
Don't update copyright.
simonhong
2014/01/09 04:36:25
Done.
| |
| 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" |
| 11 #include "cc/resources/resource_update.h" | 11 #include "cc/resources/resource_update.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 duration, | 84 duration, |
| 85 content_rect.width() * content_rect.height()); | 85 content_rect.width() * content_rect.height()); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void BitmapContentLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue, | 88 void BitmapContentLayerUpdater::UpdateTexture(ResourceUpdateQueue* queue, |
| 89 PrioritizedResource* texture, | 89 PrioritizedResource* texture, |
| 90 gfx::Rect source_rect, | 90 gfx::Rect source_rect, |
| 91 gfx::Vector2d dest_offset, | 91 gfx::Vector2d dest_offset, |
| 92 bool partial_update) { | 92 bool partial_update) { |
| 93 CHECK(canvas_); | 93 CHECK(canvas_); |
| 94 ResourceUpdate upload = | 94 ResourceUpdate upload = ResourceUpdate::Create(texture, |
| 95 ResourceUpdate::CreateFromCanvas(texture, | 95 &bitmap_backing_, |
|
enne (OOO)
2014/01/08 17:51:45
Can this function be removed now along with the ca
simonhong
2014/01/09 04:36:25
I already removed ResourceUpdate::CreateFromCanvas
| |
| 96 canvas_, | 96 content_rect(), |
| 97 content_rect(), | 97 source_rect, |
| 98 source_rect, | 98 dest_offset); |
| 99 dest_offset); | |
| 100 if (partial_update) | 99 if (partial_update) |
| 101 queue->AppendPartialUpload(upload); | 100 queue->AppendPartialUpload(upload); |
| 102 else | 101 else |
| 103 queue->AppendFullUpload(upload); | 102 queue->AppendFullUpload(upload); |
| 104 } | 103 } |
| 105 | 104 |
| 106 void BitmapContentLayerUpdater::ReduceMemoryUsage() { | 105 void BitmapContentLayerUpdater::ReduceMemoryUsage() { |
| 107 canvas_.clear(); | 106 canvas_.clear(); |
| 108 canvas_size_ = gfx::Size(); | 107 canvas_size_ = gfx::Size(); |
| 109 } | 108 } |
| 110 | 109 |
| 111 void BitmapContentLayerUpdater::SetOpaque(bool opaque) { | 110 void BitmapContentLayerUpdater::SetOpaque(bool opaque) { |
| 112 if (opaque != layer_is_opaque_) { | 111 if (opaque != layer_is_opaque_) { |
| 113 canvas_.clear(); | 112 canvas_.clear(); |
| 114 canvas_size_ = gfx::Size(); | 113 canvas_size_ = gfx::Size(); |
| 115 } | 114 } |
| 116 | 115 |
| 117 ContentLayerUpdater::SetOpaque(opaque); | 116 ContentLayerUpdater::SetOpaque(opaque); |
| 118 } | 117 } |
| 119 | 118 |
| 120 } // namespace cc | 119 } // namespace cc |
| OLD | NEW |