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

Unified Diff: cc/output/gl_renderer.cc

Issue 2297213003: Fix CSS reference filters with negative transformed children. (Closed)
Patch Set: Created 4 years, 4 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/render_surface_impl.cc ('k') | cc/output/overlay_unittest.cc » ('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 12520a51d6bcfb687c25892864d3386c9e077669..26d5272910ba96298a17bebf81bb4859592dfb10 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -665,7 +665,8 @@ static sk_sp<SkImage> ApplyImageFilter(
const Resource* source_texture_resource,
SkIPoint* offset,
SkIRect* subset,
- bool flip_texture) {
+ bool flip_texture,
+ const gfx::PointF& origin) {
if (!filter || !use_gr_context)
return nullptr;
@@ -683,8 +684,9 @@ static sk_sp<SkImage> ApplyImageFilter(
}
SkMatrix local_matrix;
- local_matrix.setTranslate(-src_rect.x(), -src_rect.y());
+ local_matrix.setTranslate(origin.x(), origin.y());
local_matrix.postScale(scale.x(), scale.y());
+ local_matrix.postTranslate(-src_rect.x(), -src_rect.y());
SkIRect clip_bounds = gfx::RectFToSkRect(dst_rect).roundOut();
clip_bounds.offset(-src_rect.x(), -src_rect.y());
@@ -1071,9 +1073,10 @@ void GLRenderer::DrawRenderPassQuadInternal(
bool GLRenderer::InitializeRPDQParameters(
DrawRenderPassDrawQuadParams* params) {
const RenderPassDrawQuad* quad = params->quad;
- SkMatrix scale_matrix;
- scale_matrix.setScale(quad->filters_scale.x(), quad->filters_scale.y());
- gfx::Rect dst_rect = quad->filters.MapRect(quad->rect, scale_matrix);
+ SkMatrix local_matrix;
+ local_matrix.setTranslate(quad->filters_origin.x(), quad->filters_origin.y());
+ local_matrix.postScale(quad->filters_scale.x(), quad->filters_scale.y());
+ gfx::Rect dst_rect = quad->filters.MapRect(quad->rect, local_matrix);
params->dst_rect.SetRect(static_cast<float>(dst_rect.x()),
static_cast<float>(dst_rect.y()),
static_cast<float>(dst_rect.width()),
@@ -1217,7 +1220,8 @@ bool GLRenderer::UpdateRPDQWithSkiaFilters(
params->filter_image = ApplyImageFilter(
ScopedUseGrContext::Create(this), resource_provider_, src_rect,
params->dst_rect, quad->filters_scale, std::move(filter),
- params->contents_texture, &offset, &subset, params->flip_texture);
+ params->contents_texture, &offset, &subset, params->flip_texture,
+ quad->filters_origin);
if (!params->filter_image)
return false;
params->dst_rect =
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698