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

Side by Side Diff: cc/picture_layer_impl.cc

Issue 12224063: cc: Make picture layer tiles multiples of 64 pixels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_impl.h" 5 #include "cc/picture_layer_impl.h"
6 6
7 #include "base/time.h" 7 #include "base/time.h"
8 #include "cc/append_quads_data.h" 8 #include "cc/append_quads_data.h"
9 #include "cc/checkerboard_draw_quad.h" 9 #include "cc/checkerboard_draw_quad.h"
10 #include "cc/debug_border_draw_quad.h" 10 #include "cc/debug_border_draw_quad.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 353
354 // If long and skinny, tile at the max untiled content size, and clamp 354 // If long and skinny, tile at the max untiled content size, and clamp
355 // the smaller dimension to the content size, e.g. 1000x12 layer with 355 // the smaller dimension to the content size, e.g. 1000x12 layer with
356 // 500x500 max untiled size would get 500x12 tiles. Also do this 356 // 500x500 max untiled size would get 500x12 tiles. Also do this
357 // if the layer is small. 357 // if the layer is small.
358 if (any_dimension_one_tile || !any_dimension_too_large) { 358 if (any_dimension_one_tile || !any_dimension_too_large) {
359 int width = 359 int width =
360 std::min(max_untiled_content_size.width(), content_bounds.width()); 360 std::min(max_untiled_content_size.width(), content_bounds.width());
361 int height = 361 int height =
362 std::min(max_untiled_content_size.height(), content_bounds.height()); 362 std::min(max_untiled_content_size.height(), content_bounds.height());
363 // Round width and height up to the closest multiple of 8. This is to 363 // Round width and height up to the closest multiple of 64. This is to
364 // help IMG drivers where facter of 8 texture sizes are faster. 364 // help IMG drivers where facter of 8 texture sizes are faster, and also
365 width = RoundUp(width, 8); 365 // to prevent creating textures of too many different size for better
366 height = RoundUp(height, 8); 366 // recycling.
367 width = RoundUp(width, 64);
368 height = RoundUp(height, 64);
367 return gfx::Size(width, height); 369 return gfx::Size(width, height);
368 } 370 }
369 371
370 return default_tile_size; 372 return default_tile_size;
371 } 373 }
372 374
373 void PictureLayerImpl::SyncFromActiveLayer() { 375 void PictureLayerImpl::SyncFromActiveLayer() {
374 DCHECK(layerTreeImpl()->IsPendingTree()); 376 DCHECK(layerTreeImpl()->IsPendingTree());
375 if (!drawsContent()) 377 if (!drawsContent())
376 return; 378 return;
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 return twin; 713 return twin;
712 } 714 }
713 715
714 void PictureLayerImpl::getDebugBorderProperties( 716 void PictureLayerImpl::getDebugBorderProperties(
715 SkColor* color, float* width) const { 717 SkColor* color, float* width) const {
716 *color = DebugColors::TiledContentLayerBorderColor(); 718 *color = DebugColors::TiledContentLayerBorderColor();
717 *width = DebugColors::TiledContentLayerBorderWidth(layerTreeImpl()); 719 *width = DebugColors::TiledContentLayerBorderWidth(layerTreeImpl());
718 } 720 }
719 721
720 } // namespace cc 722 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698