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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/debug/trace_event_argument.h" | 11 #include "base/debug/trace_event_argument.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "cc/base/math_util.h" | 13 #include "cc/base/math_util.h" |
14 #include "cc/base/util.h" | 14 #include "cc/base/util.h" |
15 #include "cc/debug/debug_colors.h" | 15 #include "cc/debug/debug_colors.h" |
16 #include "cc/debug/micro_benchmark_impl.h" | 16 #include "cc/debug/micro_benchmark_impl.h" |
17 #include "cc/debug/traced_value.h" | 17 #include "cc/debug/traced_value.h" |
18 #include "cc/layers/append_quads_data.h" | 18 #include "cc/layers/append_quads_data.h" |
19 #include "cc/layers/solid_color_layer_impl.h" | 19 #include "cc/layers/solid_color_layer_impl.h" |
20 #include "cc/output/begin_frame_args.h" | 20 #include "cc/output/begin_frame_args.h" |
21 #include "cc/quads/checkerboard_draw_quad.h" | 21 #include "cc/quads/checkerboard_draw_quad.h" |
22 #include "cc/quads/debug_border_draw_quad.h" | 22 #include "cc/quads/debug_border_draw_quad.h" |
23 #include "cc/quads/picture_draw_quad.h" | 23 #include "cc/quads/picture_draw_quad.h" |
24 #include "cc/quads/solid_color_draw_quad.h" | 24 #include "cc/quads/solid_color_draw_quad.h" |
25 #include "cc/quads/tile_draw_quad.h" | 25 #include "cc/quads/tile_draw_quad.h" |
26 #include "cc/resources/tile_manager.h" | 26 #include "cc/resources/tile_manager.h" |
27 #include "cc/trees/layer_tree_impl.h" | 27 #include "cc/trees/layer_tree_impl.h" |
28 #include "cc/trees/occlusion.h" | 28 #include "cc/trees/occlusion.h" |
29 #include "ui/gfx/quad_f.h" | 29 #include "ui/gfx/geometry/quad_f.h" |
30 #include "ui/gfx/rect_conversions.h" | 30 #include "ui/gfx/geometry/rect_conversions.h" |
31 #include "ui/gfx/size_conversions.h" | 31 #include "ui/gfx/geometry/size_conversions.h" |
32 | 32 |
33 namespace { | 33 namespace { |
34 const float kMaxScaleRatioDuringPinch = 2.0f; | 34 const float kMaxScaleRatioDuringPinch = 2.0f; |
35 | 35 |
36 // When creating a new tiling during pinch, snap to an existing | 36 // When creating a new tiling during pinch, snap to an existing |
37 // tiling's scale if the desired scale is within this ratio. | 37 // tiling's scale if the desired scale is within this ratio. |
38 const float kSnapToExistingTilingRatio = 1.2f; | 38 const float kSnapToExistingTilingRatio = 1.2f; |
39 | 39 |
40 // Estimate skewport 60 frames ahead for pre-rasterization on the CPU. | 40 // Estimate skewport 60 frames ahead for pre-rasterization on the CPU. |
41 const float kCpuSkewportTargetTimeInFrames = 60.0f; | 41 const float kCpuSkewportTargetTimeInFrames = 60.0f; |
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1676 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1677 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1677 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1678 return tiling_range.end - 1 - current_tiling_range_offset; | 1678 return tiling_range.end - 1 - current_tiling_range_offset; |
1679 } | 1679 } |
1680 } | 1680 } |
1681 NOTREACHED(); | 1681 NOTREACHED(); |
1682 return 0; | 1682 return 0; |
1683 } | 1683 } |
1684 | 1684 |
1685 } // namespace cc | 1685 } // namespace cc |
OLD | NEW |