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

Side by Side Diff: cc/layers/tiled_layer.cc

Issue 147603006: [#7] Resubmitted - Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resubmit 145313006 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/layers/tiled_layer.h ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('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/layers/tiled_layer.h" 5 #include "cc/layers/tiled_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // Invalidate any areas that the new bounds exposes. 151 // Invalidate any areas that the new bounds exposes.
152 Region old_region = gfx::Rect(old_bounds); 152 Region old_region = gfx::Rect(old_bounds);
153 Region new_region = gfx::Rect(new_bounds); 153 Region new_region = gfx::Rect(new_bounds);
154 new_region.Subtract(old_region); 154 new_region.Subtract(old_region);
155 for (Region::Iterator new_rects(new_region); 155 for (Region::Iterator new_rects(new_region);
156 new_rects.has_rect(); 156 new_rects.has_rect();
157 new_rects.next()) 157 new_rects.next())
158 InvalidateContentRect(new_rects.rect()); 158 InvalidateContentRect(new_rects.rect());
159 } 159 }
160 160
161 void TiledLayer::SetTileSize(gfx::Size size) { tiler_->SetTileSize(size); } 161 void TiledLayer::SetTileSize(const gfx::Size& size) {
162 tiler_->SetTileSize(size);
163 }
162 164
163 void TiledLayer::SetBorderTexelOption( 165 void TiledLayer::SetBorderTexelOption(
164 LayerTilingData::BorderTexelOption border_texel_option) { 166 LayerTilingData::BorderTexelOption border_texel_option) {
165 tiler_->SetBorderTexelOption(border_texel_option); 167 tiler_->SetBorderTexelOption(border_texel_option);
166 } 168 }
167 169
168 bool TiledLayer::DrawsContent() const { 170 bool TiledLayer::DrawsContent() const {
169 if (!ContentsScalingLayer::DrawsContent()) 171 if (!ContentsScalingLayer::DrawsContent())
170 return false; 172 return false;
171 173
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 gfx::Rect prepaint_rect = visible_content_rect(); 913 gfx::Rect prepaint_rect = visible_content_rect();
912 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, 914 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns,
913 -tiler_->tile_size().height() * kPrepaintRows); 915 -tiler_->tile_size().height() * kPrepaintRows);
914 gfx::Rect content_rect(content_bounds()); 916 gfx::Rect content_rect(content_bounds());
915 prepaint_rect.Intersect(content_rect); 917 prepaint_rect.Intersect(content_rect);
916 918
917 return prepaint_rect; 919 return prepaint_rect;
918 } 920 }
919 921
920 } // namespace cc 922 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer.h ('k') | cc/layers/tiled_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698