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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « cc/resources/bitmap_content_layer_updater.h ('k') | cc/resources/layer_tiling_data.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {} 48 BitmapContentLayerUpdater::~BitmapContentLayerUpdater() {}
49 49
50 scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource( 50 scoped_ptr<LayerUpdater::Resource> BitmapContentLayerUpdater::CreateResource(
51 PrioritizedResourceManager* manager) { 51 PrioritizedResourceManager* manager) {
52 return scoped_ptr<LayerUpdater::Resource>( 52 return scoped_ptr<LayerUpdater::Resource>(
53 new Resource(this, PrioritizedResource::Create(manager))); 53 new Resource(this, PrioritizedResource::Create(manager)));
54 } 54 }
55 55
56 void BitmapContentLayerUpdater::PrepareToUpdate( 56 void BitmapContentLayerUpdater::PrepareToUpdate(
57 const gfx::Rect& content_rect, 57 const gfx::Rect& content_rect,
58 gfx::Size tile_size, 58 const gfx::Size& tile_size,
59 float contents_width_scale, 59 float contents_width_scale,
60 float contents_height_scale, 60 float contents_height_scale,
61 gfx::Rect* resulting_opaque_rect) { 61 gfx::Rect* resulting_opaque_rect) {
62 if (canvas_size_ != content_rect.size()) { 62 if (canvas_size_ != content_rect.size()) {
63 devtools_instrumentation::ScopedLayerTask paint_setup( 63 devtools_instrumentation::ScopedLayerTask paint_setup(
64 devtools_instrumentation::kPaintSetup, layer_id_); 64 devtools_instrumentation::kPaintSetup, layer_id_);
65 canvas_size_ = content_rect.size(); 65 canvas_size_ = content_rect.size();
66 bitmap_backing_.setConfig( 66 bitmap_backing_.setConfig(
67 SkBitmap::kARGB_8888_Config, 67 SkBitmap::kARGB_8888_Config,
68 canvas_size_.width(), canvas_size_.height(), 68 canvas_size_.width(), canvas_size_.height(),
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void BitmapContentLayerUpdater::SetOpaque(bool opaque) { 110 void BitmapContentLayerUpdater::SetOpaque(bool opaque) {
111 if (opaque != layer_is_opaque_) { 111 if (opaque != layer_is_opaque_) {
112 canvas_.clear(); 112 canvas_.clear();
113 canvas_size_ = gfx::Size(); 113 canvas_size_ = gfx::Size();
114 } 114 }
115 115
116 ContentLayerUpdater::SetOpaque(opaque); 116 ContentLayerUpdater::SetOpaque(opaque);
117 } 117 }
118 118
119 } // namespace cc 119 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/bitmap_content_layer_updater.h ('k') | cc/resources/layer_tiling_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698