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

Side by Side Diff: cc/layers/render_surface_impl.cc

Issue 2018983003: cc: Use FilterOperations::MapRect in RenderSurfaceImpl::DrawableContentRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust LayerTreeHostCommonTest.RenderSurfaceListForFilter Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/render_surface_impl.h" 5 #include "cc/layers/render_surface_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 RenderSurfaceImpl::DrawProperties::~DrawProperties() {} 70 RenderSurfaceImpl::DrawProperties::~DrawProperties() {}
71 71
72 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { 72 gfx::RectF RenderSurfaceImpl::DrawableContentRect() const {
73 if (content_rect().IsEmpty()) 73 if (content_rect().IsEmpty())
74 return gfx::RectF(); 74 return gfx::RectF();
75 75
76 gfx::Rect surface_content_rect = content_rect(); 76 gfx::Rect surface_content_rect = content_rect();
77 if (!owning_layer_->filters().IsEmpty()) { 77 if (!owning_layer_->filters().IsEmpty()) {
78 int left, top, right, bottom; 78 LOG(ERROR) << "content_rect " << content_rect().ToString();
Stephen White 2016/06/06 17:27:02 I'm assuming this is safe to leave in, perf-wise.
79 owning_layer_->filters().GetOutsets(&top, &right, &bottom, &left); 79 const gfx::Transform& owning_layer_draw_transform =
80 surface_content_rect.Inset(-left, -top, -right, -bottom); 80 owning_layer_->DrawTransform();
81 DCHECK(owning_layer_draw_transform.IsScale2d());
82 surface_content_rect = owning_layer_->filters().MapRect(
83 surface_content_rect, owning_layer_draw_transform.matrix());
81 } 84 }
82 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect( 85 gfx::RectF drawable_content_rect = MathUtil::MapClippedRect(
83 draw_transform(), gfx::RectF(surface_content_rect)); 86 draw_transform(), gfx::RectF(surface_content_rect));
84 if (owning_layer_->has_replica()) { 87 if (owning_layer_->has_replica()) {
85 drawable_content_rect.Union(MathUtil::MapClippedRect( 88 drawable_content_rect.Union(MathUtil::MapClippedRect(
86 replica_draw_transform(), gfx::RectF(surface_content_rect))); 89 replica_draw_transform(), gfx::RectF(surface_content_rect)));
87 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) { 90 } else if (!owning_layer_->filters().IsEmpty() && is_clipped()) {
88 // Filter could move pixels around, but still need to be clipped. 91 // Filter could move pixels around, but still need to be clipped.
89 drawable_content_rect.Intersect(gfx::RectF(clip_rect())); 92 drawable_content_rect.Intersect(gfx::RectF(clip_rect()));
90 } 93 }
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 RenderPassDrawQuad* quad = 364 RenderPassDrawQuad* quad =
362 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 365 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
363 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect, 366 quad->SetNew(shared_quad_state, content_rect(), visible_layer_rect,
364 render_pass_id, mask_resource_id, mask_uv_scale, 367 render_pass_id, mask_resource_id, mask_uv_scale,
365 mask_texture_size, owning_layer_->filters(), 368 mask_texture_size, owning_layer_->filters(),
366 owning_layer_to_target_scale, 369 owning_layer_to_target_scale,
367 owning_layer_->background_filters()); 370 owning_layer_->background_filters());
368 } 371 }
369 372
370 } // namespace cc 373 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698