OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |