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

Unified Diff: cc/output/gl_renderer.cc

Issue 23060011: Pass the quad's rect (contents_rect) origin to skia image filters as an offset in the CTM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « no previous file | no next file » | 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 d1cbec3dd608ad8022206e35561eb73e2d63e10e..3b5d138fb5c7be7fb93c0e3e1bedc4958b5e74c3 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -515,6 +515,7 @@ static inline SkBitmap ApplyFilters(GLRenderer* renderer,
}
static SkBitmap ApplyImageFilter(GLRenderer* renderer,
+ gfx::Rect rect,
danakj 2013/08/19 21:09:08 better variable name than the type of the variable
SkImageFilter* filter,
ScopedResource* source_texture_resource) {
if (!filter)
@@ -581,6 +582,7 @@ static SkBitmap ApplyImageFilter(GLRenderer* renderer,
SkPaint paint;
paint.setImageFilter(filter);
canvas.clear(SK_ColorTRANSPARENT);
+ canvas.translate(SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()));
canvas.drawSprite(source, 0, 0, &paint);
// Flush skia context so that all the rendered stuff appears on the
@@ -777,8 +779,8 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
// in the compositor.
use_color_matrix = true;
} else {
- filter_bitmap =
- ApplyImageFilter(this, quad->filter.get(), contents_texture);
+ filter_bitmap = ApplyImageFilter(
+ this, quad->rect, quad->filter.get(), contents_texture);
}
} else if (!quad->filters.IsEmpty()) {
FilterOperations optimized_filters =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698