summaryrefslogtreecommitdiffstats
path: root/cc/resources
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 23:45:15 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 23:45:15 +0000
commit2d8d34e682613af32604d4892459a94dbba50471 (patch)
tree399fd0dc79833587603257354dfbd2afad28f893 /cc/resources
parent322c631b25373a28fd7c270cc55d0d9b30b09a4f (diff)
downloadchromium_src-2d8d34e682613af32604d4892459a94dbba50471.zip
chromium_src-2d8d34e682613af32604d4892459a94dbba50471.tar.gz
chromium_src-2d8d34e682613af32604d4892459a94dbba50471.tar.bz2
cc: Remove gpu-rasterization flag from Tile.
The flag was used for two things: 1. Sorting the raster taks into separate raster queues by rasterizer delegate. The rasterizer delegate is gone, so this is no longer needed. 2. Determining if we should analyze picture pile to detect solid-color tiles. This patch replaces the gpu rasterization flag with an explicit picture analysis flag. BUG=367200 Review URL: https://codereview.chromium.org/288343012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/resources')
-rw-r--r--cc/resources/tile.cc2
-rw-r--r--cc/resources/tile.h16
-rw-r--r--cc/resources/tile_manager.cc23
3 files changed, 5 insertions, 36 deletions
diff --git a/cc/resources/tile.cc b/cc/resources/tile.cc
index f976cfe..485e230 100644
--- a/cc/resources/tile.cc
+++ b/cc/resources/tile.cc
@@ -72,7 +72,7 @@ scoped_ptr<base::Value> Tile::AsValue() const {
res->Set("pending_priority", priority_[PENDING_TREE].AsValue().release());
res->Set("managed_state", managed_state_.AsValue().release());
res->SetBoolean("can_use_lcd_text", can_use_lcd_text());
- res->SetBoolean("use_gpu_rasterization", use_gpu_rasterization());
+ res->SetBoolean("use_picture_analysis", use_picture_analysis());
return res.PassAs<base::Value>();
}
diff --git a/cc/resources/tile.h b/cc/resources/tile.h
index a1e1c35..d7cb16b 100644
--- a/cc/resources/tile.h
+++ b/cc/resources/tile.h
@@ -20,10 +20,7 @@ namespace cc {
class CC_EXPORT Tile : public RefCountedManaged<Tile> {
public:
- enum TileRasterFlags {
- USE_LCD_TEXT = 1 << 0,
- USE_GPU_RASTERIZATION = 1 << 1
- };
+ enum TileRasterFlags { USE_LCD_TEXT = 1 << 0, USE_PICTURE_ANALYSIS = 1 << 1 };
typedef uint64 Id;
@@ -80,15 +77,8 @@ class CC_EXPORT Tile : public RefCountedManaged<Tile> {
return !!(flags_ & USE_LCD_TEXT);
}
- void set_use_gpu_rasterization(bool use_gpu_rasterization) {
- if (use_gpu_rasterization)
- flags_ |= USE_GPU_RASTERIZATION;
- else
- flags_ &= ~USE_GPU_RASTERIZATION;
- }
-
- bool use_gpu_rasterization() const {
- return !!(flags_ & USE_GPU_RASTERIZATION);
+ bool use_picture_analysis() const {
+ return !!(flags_ & USE_PICTURE_ANALYSIS);
}
bool NeedsRasterForMode(RasterMode mode) const {
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index 416c4e6..c88ba66 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -30,9 +30,6 @@ namespace {
// a tile is of solid color.
const bool kUseColorEstimator = true;
-// Minimum width/height of a pile that would require analysis for tiles.
-const int kMinDimensionsForAnalysis = 256;
-
class DisableLCDTextFilter : public SkDrawFilter {
public:
// SkDrawFilter interface.
@@ -1108,24 +1105,6 @@ scoped_refptr<RasterTask> TileManager::CreateRasterTask(Tile* tile) {
existing_pixel_refs[id] = decode_task;
}
- // We analyze picture before rasterization to detect solid-color tiles.
- // If the tile is detected as such there is no need to raster or upload.
- // It is drawn directly as a solid-color quad saving raster and upload cost.
- // The analysis step is however expensive and is not justified when doing
- // gpu rasterization where there is no upload.
- //
- // Additionally, we do not want to do the analysis if the layer that produced
- // this tile is narrow, since more likely than not the tile would not be
- // solid. We use the picture pile size as a proxy for layer size, since it
- // represents the recorded (and thus rasterizable) content.
- // Note that this last optimization is a heuristic that ensures that we don't
- // spend too much time analyzing tiles on a multitude of small layers, as it
- // is likely that these layers have some non-solid content.
- gfx::Size pile_size = tile->picture_pile()->tiling_rect().size();
- bool analyze_picture = !tile->use_gpu_rasterization() &&
- std::min(pile_size.width(), pile_size.height()) >=
- kMinDimensionsForAnalysis;
-
return make_scoped_refptr(
new RasterTaskImpl(const_resource,
tile->picture_pile(),
@@ -1136,7 +1115,7 @@ scoped_refptr<RasterTask> TileManager::CreateRasterTask(Tile* tile) {
tile->layer_id(),
static_cast<const void*>(tile),
tile->source_frame_number(),
- analyze_picture,
+ tile->use_picture_analysis(),
rendering_stats_instrumentation_,
base::Bind(&TileManager::OnRasterTaskCompleted,
base::Unretained(this),