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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/tiled_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer_impl.cc
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index 54cfac88b32ec722abac90809ad0c5c9486e7731..36ac1ac30e9f155d556126ce2ccf0e791b2f9a7b 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -277,6 +277,9 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
} else if (mode == ManagedTileState::DrawInfo::PICTURE_PILE_MODE) {
color = DebugColors::PictureTileBorderColor();
width = DebugColors::PictureTileBorderWidth(layer_tree_impl());
+ } else if (iter->draw_info().has_compressed_resource()) {
+ color = DebugColors::CompressedTileBorderColor();
+ width = DebugColors::CompressedTileBorderWidth(layer_tree_impl());
} else if (iter.resolution() == HIGH_RESOLUTION) {
color = DebugColors::HighResTileBorderColor();
width = DebugColors::HighResTileBorderWidth(layer_tree_impl());
@@ -381,7 +384,8 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
ResourceProvider* resource_provider =
layer_tree_impl()->resource_provider();
ResourceFormat format =
- resource_provider->memory_efficient_texture_format();
+ resource_provider->memory_efficient_texture_format(
+ FORMAT_USAGE_NATIVE);
PictureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
@@ -616,17 +620,18 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() {
}
scoped_refptr<Tile> PictureLayerImpl::CreateTile(PictureLayerTiling* tiling,
- const gfx::Rect& content_rect) {
+ const gfx::Rect& content_rect,
+ int flags) {
DCHECK(!raster_source_->IsSolidColor());
if (!raster_source_->CoversRect(content_rect, tiling->contents_scale()))
return scoped_refptr<Tile>();
- int flags = 0;
-
// We don't handle solid color masks, so we shouldn't bother analyzing those.
// Otherwise, always analyze to maximize memory savings.
if (!is_mask_)
- flags = Tile::USE_PICTURE_ANALYSIS;
+ flags |= Tile::USE_PICTURE_ANALYSIS;
+ if (contents_opaque())
+ flags |= Tile::IS_OPAQUE;
return layer_tree_impl()->tile_manager()->CreateTile(
raster_source_.get(), content_rect.size(), content_rect,
@@ -784,7 +789,8 @@ void PictureLayerImpl::SyncFromActiveLayer(const PictureLayerImpl* other) {
if (CanHaveTilings()) {
synced_high_res_tiling = tilings_->SyncTilings(
*other->tilings_, raster_source_->GetSize(), invalidation_,
- MinimumContentsScale(), raster_source_.get());
+ MinimumContentsScale(), raster_source_.get(),
+ layer_tree_impl()->CurrentBeginFrameArgs().frame_time);
} else {
RemoveAllTilings();
}
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698