Skip to content

Commit

Permalink
cc: Make skewport target time be specified in seconds.
Browse files Browse the repository at this point in the history
This patch removes in-frames skewport target with some calculations
to convert it to seconds. Instead, the skewport time is specified
in seconds directly. In GPU raster mode, the skewport target is 0.f
as before.

R=ernstm, danakj

Review URL: https://codereview.chromium.org/784983002

Cr-Commit-Position: refs/heads/master@{#307537}
  • Loading branch information
vmpstr authored and Commit bot committed Dec 9, 2014
1 parent 71ca6f9 commit abd4d0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
17 changes: 3 additions & 14 deletions cc/layers/picture_layer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ const float kMaxScaleRatioDuringPinch = 2.0f;
// tiling's scale if the desired scale is within this ratio.
const float kSnapToExistingTilingRatio = 1.2f;

// Estimate skewport 60 frames ahead for pre-rasterization on the CPU.
const float kCpuSkewportTargetTimeInFrames = 60.0f;

// Don't pre-rasterize on the GPU (except for kBackflingGuardDistancePixels in
// TileManager::BinFromTilePriority).
const float kGpuSkewportTargetTimeInFrames = 0.0f;

// Even for really wide viewports, at some point GPU raster should use
// less than 4 tiles to fill the viewport. This is set to 256 as a
// sane minimum for now, but we might want to tune this for low-end.
Expand Down Expand Up @@ -684,13 +677,9 @@ size_t PictureLayerImpl::GetMaxTilesForInterestArea() const {
}

float PictureLayerImpl::GetSkewportTargetTimeInSeconds() const {
float skewport_target_time_in_frames =
layer_tree_impl()->use_gpu_rasterization()
? kGpuSkewportTargetTimeInFrames
: kCpuSkewportTargetTimeInFrames;
return skewport_target_time_in_frames *
layer_tree_impl()->begin_impl_frame_interval().InSecondsF() *
layer_tree_impl()->settings().skewport_target_time_multiplier;
return layer_tree_impl()->use_gpu_rasterization()
? 0.f
: layer_tree_impl()->settings().skewport_target_time_in_seconds;
}

int PictureLayerImpl::GetSkewportExtrapolationLimitInContentPixels() const {
Expand Down
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_settings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ LayerTreeSettings::LayerTreeSettings()
use_pinch_virtual_viewport(false),
// At 256x256 tiles, 128 tiles cover an area of 2048x4096 pixels.
max_tiles_for_interest_area(128),
skewport_target_time_multiplier(1.0f),
skewport_target_time_in_seconds(1.0f),
skewport_extrapolation_limit_in_content_pixels(2000),
max_unused_resource_memory_percentage(100),
max_memory_for_prepaint_percentage(100),
Expand Down
2 changes: 1 addition & 1 deletion cc/trees/layer_tree_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CC_EXPORT LayerTreeSettings {
bool use_pinch_zoom_scrollbars;
bool use_pinch_virtual_viewport;
size_t max_tiles_for_interest_area;
float skewport_target_time_multiplier;
float skewport_target_time_in_seconds;
int skewport_extrapolation_limit_in_content_pixels;
size_t max_unused_resource_memory_percentage;
size_t max_memory_for_prepaint_percentage;
Expand Down

0 comments on commit abd4d0c

Please sign in to comment.