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

Unified Diff: cc/output/gl_renderer.cc

Issue 1643983002: cc: use Skia's filterBounds() traversal, not computeFastBounds(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mark tests to be rebaselined; fix spacing Created 4 years, 11 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 | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index ba75b232256c274e976d350284983160e78b0cc2..67382c0765fdbda850124277406ad9363786b6e4 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -988,23 +988,13 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
} else {
gfx::RectF src_rect = rect;
gfx::Vector2dF scale = quad->filters_scale;
- // Compute the destination rect for the filtered output.
- // Note that we leave the dest rect equal to the src rect when
- // a filter chain cannot compute its bounds. This is correct
- // behaviour, but Skia is a little conservative at the moment.
- // Once Skia makes the fast-bounds traversal crop-rect aware
- // (http://skbug.com/4627), this won't be a problem
- // for Chrome since Blink always sets a crop rect on the leaf nodes
- // of the DAG, making it always computable.
- // TODO(senorblanco): remove this comment when http://skbug.com/4627
- // is fixed.
- if (filter->canComputeFastBounds()) {
- SkRect result_rect;
- rect.Scale(1.0f / scale.x(), 1.0f / scale.y());
- filter->computeFastBounds(gfx::RectFToSkRect(rect), &result_rect);
- rect = gfx::SkRectToRectF(result_rect);
- rect.Scale(scale.x(), scale.y());
- }
+ SkMatrix scale_matrix;
+ scale_matrix.setScale(scale.x(), scale.y());
+ SkIRect result_rect;
+ filter->filterBounds(gfx::RectToSkIRect(quad->rect), scale_matrix,
+ &result_rect,
+ SkImageFilter::kForward_MapDirection);
+ rect = gfx::SkRectToRectF(SkRect::Make(result_rect));
filter_image = ApplyImageFilter(ScopedUseGrContext::Create(this, frame),
resource_provider_, src_rect, rect,
scale, filter.get(), contents_texture);
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698