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

Unified Diff: cc/layers/surface_layer_impl.cc

Issue 1166983007: Fix SurfaceLayerImpl scale under impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/surface_layer_impl.cc
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc
index 966112d7f546c1147471fdaf4f68d93fe395cc80..dc70b533f07dba1b491a16e710a62df99e5d17b5 100644
--- a/cc/layers/surface_layer_impl.cc
+++ b/cc/layers/surface_layer_impl.cc
@@ -30,18 +30,36 @@ void SurfaceLayerImpl::SetSurfaceId(SurfaceId surface_id) {
NoteLayerPropertyChanged();
}
+void SurfaceLayerImpl::SetSurfaceScale(float scale) {
+ if (surface_scale_ == scale)
+ return;
+
+ surface_scale_ = scale;
+ NoteLayerPropertyChanged();
+}
+
+void SurfaceLayerImpl::SetSurfaceSize(const gfx::Size& size) {
+ if (surface_size_ == size)
+ return;
+
+ surface_size_ = size;
+ NoteLayerPropertyChanged();
+}
+
void SurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) {
LayerImpl::PushPropertiesTo(layer);
SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer);
layer_impl->SetSurfaceId(surface_id_);
+ layer_impl->SetSurfaceSize(surface_size_);
+ layer_impl->SetSurfaceScale(surface_scale_);
}
void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
AppendQuadsData* append_quads_data) {
SharedQuadState* shared_quad_state =
render_pass->CreateAndAppendSharedQuadState();
- PopulateSharedQuadState(shared_quad_state);
+ PopulateScaledSharedQuadState(shared_quad_state, surface_scale_);
AppendDebugBorderQuad(
render_pass, content_bounds(), shared_quad_state, append_quads_data);
danakj 2015/06/04 21:25:18 i thin this should match the size of the quad.
@@ -49,7 +67,7 @@ void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
if (surface_id_.is_null())
return;
- gfx::Rect quad_rect(content_bounds());
+ gfx::Rect quad_rect(surface_size_);
gfx::Rect visible_quad_rect =
draw_properties().occlusion_in_content_space.GetUnoccludedContentRect(
quad_rect);
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698