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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 789433003: [cc] Add nearest neighbor filtering for PictureLayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase 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_impl.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 23351d7a3fba8e0082577ea486a6ab674e69de50..f5ba485f3141c2d330fdfed3b2ced54af07a8ebe 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -85,7 +85,8 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl,
needs_post_commit_initialization_(true),
should_update_tile_priorities_(false),
only_used_low_res_last_append_quads_(false),
- is_mask_(is_mask) {
+ is_mask_(is_mask),
+ nearest_neighbor_(false) {
layer_tree_impl()->RegisterPictureLayerImpl(this);
}
@@ -139,6 +140,8 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
twin_layer_ = layer_impl;
layer_impl->twin_layer_ = this;
+ layer_impl->SetNearestNeighbor(nearest_neighbor_);
+
// Solid color layers have no tilings.
DCHECK_IMPLIES(raster_source_->IsSolidColor(), tilings_->num_tilings() == 0);
// The pending tree should only have a high res (and possibly low res) tiling.
@@ -239,8 +242,9 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
PictureDrawQuad* quad =
render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
- visible_geometry_rect, texture_rect, texture_size, RGBA_8888,
- quad_content_rect, max_contents_scale, raster_source_);
+ visible_geometry_rect, texture_rect, texture_size,
+ nearest_neighbor_, RGBA_8888, quad_content_rect,
+ max_contents_scale, raster_source_);
return;
}
@@ -352,7 +356,8 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
draw_info.get_resource_id(),
texture_rect,
iter.texture_size(),
- draw_info.contents_swizzled());
+ draw_info.contents_swizzled(),
+ nearest_neighbor_);
has_draw_quad = true;
break;
}
@@ -374,8 +379,8 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass,
render_pass->CreateAndAppendDrawQuad<PictureDrawQuad>();
quad->SetNew(shared_quad_state, geometry_rect, opaque_rect,
visible_geometry_rect, texture_rect, iter.texture_size(),
- format, iter->content_rect(), iter->contents_scale(),
- raster_source_);
+ nearest_neighbor_, format, iter->content_rect(),
+ iter->contents_scale(), raster_source_);
has_draw_quad = true;
break;
}
@@ -821,6 +826,14 @@ void PictureLayerImpl::GetContentsResourceId(
*resource_size = iter.texture_size();
}
+void PictureLayerImpl::SetNearestNeighbor(bool nearest_neighbor) {
+ if (nearest_neighbor_ == nearest_neighbor)
+ return;
+
+ nearest_neighbor_ = nearest_neighbor;
+ NoteLayerPropertyChanged();
+}
+
void PictureLayerImpl::DoPostCommitInitialization() {
// TODO(danakj): Remove this.
DCHECK(needs_post_commit_initialization_);
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/tiled_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698