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

Unified Diff: cc/output/gl_renderer.cc

Issue 1942863002: cc: fix pixel-moving filter effects on a rotated layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comment Created 4 years, 8 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/output/software_renderer.h » ('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 5c5f331108ab5edeb4c2cbb672b48fdadf9855dc..6a75674271e6921f2f0658f281f12aa86425776e 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1010,6 +1010,14 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
filter->filterBounds(gfx::RectToSkIRect(quad->rect), scale_matrix,
SkImageFilter::kForward_MapDirection);
gfx::RectF dst_rect = gfx::SkRectToRectF(SkRect::Make(result_rect));
+ // If the destination rect is not the same as the source rect, the edges
+ // previously computed for AA will be wrong. Rather than recompute them
+ // here, disable antialiasing and use a 1-pixel transparent
+ // border to achieve a similar effect.
+ if (use_aa && dst_rect != rect) {
+ dst_rect.Inset(-1.0f, -1.0f);
+ use_aa = false;
+ }
gfx::Rect clip_rect = quad->shared_quad_state->clip_rect;
if (clip_rect.IsEmpty()) {
clip_rect = current_draw_rect_;
@@ -1052,6 +1060,8 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
if (filter_image_id) {
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_2D, filter_image_id);
+ gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
} else {
contents_resource_lock =
base::WrapUnique(new ResourceProvider::ScopedSamplerGL(
« no previous file with comments | « no previous file | cc/output/software_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698