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/tile_manager.h" | 5 #include "cc/tile_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 // The amount of time for which we want to have prepainting coverage. | 43 // The amount of time for which we want to have prepainting coverage. |
44 const double prepainting_window_time_seconds = 1.0; | 44 const double prepainting_window_time_seconds = 1.0; |
45 const double backfling_guard_distance_pixels = 314.0; | 45 const double backfling_guard_distance_pixels = 314.0; |
46 | 46 |
47 // Explicitly limit how far ahead we will prepaint to limit memory usage. | 47 // Explicitly limit how far ahead we will prepaint to limit memory usage. |
48 if (prio.distance_to_visible_in_pixels > | 48 if (prio.distance_to_visible_in_pixels > |
49 TilePriority::kMaxDistanceInContentSpace) | 49 TilePriority::kMaxDistanceInContentSpace) |
50 return NEVER_BIN; | 50 return NEVER_BIN; |
51 | 51 |
52 if (prio.time_to_visible_in_seconds == std::numeric_limits<float>::max()) | 52 if (prio.time_to_visible_in_seconds == std::numeric_limits<float>::infinity()) |
53 return NEVER_BIN; | 53 return NEVER_BIN; |
54 | 54 |
55 if (prio.time_to_visible_in_seconds == 0 || | 55 if (prio.time_to_visible_in_seconds == 0 || |
56 prio.distance_to_visible_in_pixels < backfling_guard_distance_pixels) | 56 prio.distance_to_visible_in_pixels < backfling_guard_distance_pixels) |
57 return NOW_BIN; | 57 return NOW_BIN; |
58 | 58 |
59 if (prio.resolution == NON_IDEAL_RESOLUTION) | 59 if (prio.resolution == NON_IDEAL_RESOLUTION) |
60 return EVENTUALLY_BIN; | 60 return EVENTUALLY_BIN; |
61 | 61 |
62 if (prio.time_to_visible_in_seconds < prepainting_window_time_seconds) | 62 if (prio.time_to_visible_in_seconds < prepainting_window_time_seconds) |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 decode_begin_time = base::TimeTicks::Now(); | 885 decode_begin_time = base::TimeTicks::Now(); |
886 pixel_ref->Decode(); | 886 pixel_ref->Decode(); |
887 if (stats) { | 887 if (stats) { |
888 stats->totalDeferredImageDecodeCount++; | 888 stats->totalDeferredImageDecodeCount++; |
889 stats->totalDeferredImageDecodeTime += | 889 stats->totalDeferredImageDecodeTime += |
890 base::TimeTicks::Now() - decode_begin_time; | 890 base::TimeTicks::Now() - decode_begin_time; |
891 } | 891 } |
892 } | 892 } |
893 | 893 |
894 } // namespace cc | 894 } // namespace cc |
OLD | NEW |