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>::infinity()) | |
53 return NEVER_BIN; | |
54 | |
55 if (prio.time_to_visible_in_seconds == 0 || | 52 if (prio.time_to_visible_in_seconds == 0 || |
56 prio.distance_to_visible_in_pixels < backfling_guard_distance_pixels) | 53 prio.distance_to_visible_in_pixels < backfling_guard_distance_pixels) |
57 return NOW_BIN; | 54 return NOW_BIN; |
58 | 55 |
59 if (prio.resolution == NON_IDEAL_RESOLUTION) | 56 if (prio.resolution == NON_IDEAL_RESOLUTION) |
60 return EVENTUALLY_BIN; | 57 return EVENTUALLY_BIN; |
61 | 58 |
62 if (prio.time_to_visible_in_seconds < prepainting_window_time_seconds) | 59 if (prio.time_to_visible_in_seconds < prepainting_window_time_seconds) |
63 return SOON_BIN; | 60 return SOON_BIN; |
64 | 61 |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 decode_begin_time = base::TimeTicks::Now(); | 882 decode_begin_time = base::TimeTicks::Now(); |
886 pixel_ref->Decode(); | 883 pixel_ref->Decode(); |
887 if (stats) { | 884 if (stats) { |
888 stats->totalDeferredImageDecodeCount++; | 885 stats->totalDeferredImageDecodeCount++; |
889 stats->totalDeferredImageDecodeTime += | 886 stats->totalDeferredImageDecodeTime += |
890 base::TimeTicks::Now() - decode_begin_time; | 887 base::TimeTicks::Now() - decode_begin_time; |
891 } | 888 } |
892 } | 889 } |
893 | 890 |
894 } // namespace cc | 891 } // namespace cc |
OLD | NEW |