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

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: Fix comments re: review 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 | cc/trees/layer_tree_host_pixeltest_filters.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 ac8c2c6f8cdfd71e603dbe82e994adf2a89eb6ad..a80feac4ecc9f97f3fd5e731d99a43cc7ea98a99 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -503,6 +503,7 @@ static inline SkBitmap ApplyFilters(GLRenderer* renderer,
static SkBitmap ApplyImageFilter(GLRenderer* renderer,
ContextProvider* offscreen_contexts,
+ gfx::Point origin,
SkImageFilter* filter,
ScopedResource* source_texture_resource) {
if (!filter)
@@ -567,6 +568,11 @@ static SkBitmap ApplyImageFilter(GLRenderer* renderer,
SkPaint paint;
paint.setImageFilter(filter);
canvas.clear(SK_ColorTRANSPARENT);
+
+ // TODO(senorblanco): in addition to the origin translation here, the canvas
enne (OOO) 2013/08/29 17:11:37 Thanks for the TODO. Scale doesn't need to be sol
+ // should also be scaled to accomodate device pixel ratio and pinch zoom. See
+ // crbug.com/281516 and crbug.com/281518.
+ canvas.translate(SkIntToScalar(-origin.x()), SkIntToScalar(-origin.y()));
canvas.drawSprite(source, 0, 0, &paint);
// Flush skia context so that all the rendered stuff appears on the
@@ -768,6 +774,7 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
} else {
filter_bitmap = ApplyImageFilter(this,
frame->offscreen_context_provider,
+ quad->rect.origin(),
quad->filter.get(),
contents_texture);
}
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_pixeltest_filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698