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

Side by Side 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, 10 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 | third_party/WebKit/LayoutTests/TestExpectations » ('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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 cf = skia::AdoptRef(colorfilter_rawptr); 981 cf = skia::AdoptRef(colorfilter_rawptr);
982 } 982 }
983 983
984 if (cf && cf->asColorMatrix(color_matrix) && !filter->getInput(0)) { 984 if (cf && cf->asColorMatrix(color_matrix) && !filter->getInput(0)) {
985 // We have a single color matrix as a filter; apply it locally 985 // We have a single color matrix as a filter; apply it locally
986 // in the compositor. 986 // in the compositor.
987 use_color_matrix = true; 987 use_color_matrix = true;
988 } else { 988 } else {
989 gfx::RectF src_rect = rect; 989 gfx::RectF src_rect = rect;
990 gfx::Vector2dF scale = quad->filters_scale; 990 gfx::Vector2dF scale = quad->filters_scale;
991 // Compute the destination rect for the filtered output. 991 SkMatrix scale_matrix;
992 // Note that we leave the dest rect equal to the src rect when 992 scale_matrix.setScale(scale.x(), scale.y());
993 // a filter chain cannot compute its bounds. This is correct 993 SkIRect result_rect;
994 // behaviour, but Skia is a little conservative at the moment. 994 filter->filterBounds(gfx::RectToSkIRect(quad->rect), scale_matrix,
995 // Once Skia makes the fast-bounds traversal crop-rect aware 995 &result_rect,
996 // (http://skbug.com/4627), this won't be a problem 996 SkImageFilter::kForward_MapDirection);
997 // for Chrome since Blink always sets a crop rect on the leaf nodes 997 rect = gfx::SkRectToRectF(SkRect::Make(result_rect));
998 // of the DAG, making it always computable.
999 // TODO(senorblanco): remove this comment when http://skbug.com/4627
1000 // is fixed.
1001 if (filter->canComputeFastBounds()) {
1002 SkRect result_rect;
1003 rect.Scale(1.0f / scale.x(), 1.0f / scale.y());
1004 filter->computeFastBounds(gfx::RectFToSkRect(rect), &result_rect);
1005 rect = gfx::SkRectToRectF(result_rect);
1006 rect.Scale(scale.x(), scale.y());
1007 }
1008 filter_image = ApplyImageFilter(ScopedUseGrContext::Create(this, frame), 998 filter_image = ApplyImageFilter(ScopedUseGrContext::Create(this, frame),
1009 resource_provider_, src_rect, rect, 999 resource_provider_, src_rect, rect,
1010 scale, filter.get(), contents_texture); 1000 scale, filter.get(), contents_texture);
1011 if (filter_image) { 1001 if (filter_image) {
1012 filter_image_id = filter_image->getTextureHandle(true); 1002 filter_image_id = filter_image->getTextureHandle(true);
1013 DCHECK(filter_image_id); 1003 DCHECK(filter_image_id);
1014 } 1004 }
1015 } 1005 }
1016 } 1006 }
1017 } 1007 }
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3607 texture_id = pending_overlay_resources_.back()->texture_id(); 3597 texture_id = pending_overlay_resources_.back()->texture_id();
3608 } 3598 }
3609 3599
3610 context_support_->ScheduleOverlayPlane( 3600 context_support_->ScheduleOverlayPlane(
3611 overlay.plane_z_order, overlay.transform, texture_id, 3601 overlay.plane_z_order, overlay.transform, texture_id,
3612 ToNearestRect(overlay.display_rect), overlay.uv_rect); 3602 ToNearestRect(overlay.display_rect), overlay.uv_rect);
3613 } 3603 }
3614 } 3604 }
3615 3605
3616 } // namespace cc 3606 } // namespace cc
OLDNEW
« 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