OLD | NEW |
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" |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "cc/base/simple_enclosed_region.h" | 13 #include "cc/base/simple_enclosed_region.h" |
14 #include "cc/layers/layer_impl.h" | 14 #include "cc/layers/layer_impl.h" |
15 #include "cc/layers/tiled_layer_impl.h" | 15 #include "cc/layers/tiled_layer_impl.h" |
16 #include "cc/resources/layer_updater.h" | 16 #include "cc/resources/layer_updater.h" |
17 #include "cc/resources/prioritized_resource.h" | 17 #include "cc/resources/prioritized_resource.h" |
18 #include "cc/resources/priority_calculator.h" | 18 #include "cc/resources/priority_calculator.h" |
19 #include "cc/trees/layer_tree_host.h" | 19 #include "cc/trees/layer_tree_host.h" |
20 #include "cc/trees/occlusion_tracker.h" | 20 #include "cc/trees/occlusion_tracker.h" |
21 #include "third_party/khronos/GLES2/gl2.h" | 21 #include "third_party/khronos/GLES2/gl2.h" |
22 #include "ui/gfx/rect_conversions.h" | 22 #include "ui/gfx/geometry/rect_conversions.h" |
23 | 23 |
24 namespace cc { | 24 namespace cc { |
25 | 25 |
26 // Maximum predictive expansion of the visible area. | 26 // Maximum predictive expansion of the visible area. |
27 static const int kMaxPredictiveTilesCount = 2; | 27 static const int kMaxPredictiveTilesCount = 2; |
28 | 28 |
29 // Number of rows/columns of tiles to pre-paint. | 29 // Number of rows/columns of tiles to pre-paint. |
30 // We should increase these further as all textures are | 30 // We should increase these further as all textures are |
31 // prioritized and we insure performance doesn't suffer. | 31 // prioritized and we insure performance doesn't suffer. |
32 static const int kPrepaintRows = 4; | 32 static const int kPrepaintRows = 4; |
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 gfx::Rect prepaint_rect = visible_content_rect(); | 861 gfx::Rect prepaint_rect = visible_content_rect(); |
862 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, | 862 prepaint_rect.Inset(-tiler_->tile_size().width() * kPrepaintColumns, |
863 -tiler_->tile_size().height() * kPrepaintRows); | 863 -tiler_->tile_size().height() * kPrepaintRows); |
864 gfx::Rect content_rect(content_bounds()); | 864 gfx::Rect content_rect(content_bounds()); |
865 prepaint_rect.Intersect(content_rect); | 865 prepaint_rect.Intersect(content_rect); |
866 | 866 |
867 return prepaint_rect; | 867 return prepaint_rect; |
868 } | 868 } |
869 | 869 |
870 } // namespace cc | 870 } // namespace cc |
OLD | NEW |