Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: cc/resources/bitmap_content_layer_updater.cc

Issue 127053004: [cc] Unify static create method of ResourceUpdate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more cleanup Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/resources/resource_update.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_,
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
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_update.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698