Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: cc/tile_manager.cc

Issue 12220115: [cc] Dont throw away tiles that stop moving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698