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

Unified Diff: cc/output/gl_renderer.cc

Issue 12571010: cc: Add a pixel test for background blur outsets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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/output/gl_renderer.h ('k') | cc/test/layer_tree_pixel_test.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 6d35914aff176225d3ee0090f479540578b4fd30..9f4c6f9ed18f30a3b5aa40d0ec783b1ce0309095 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -562,11 +562,10 @@ scoped_ptr<ScopedResource> GLRenderer::DrawBackgroundFilters(
// Pixel copies in this algorithm occur at steps 2, 3, 4, and 5.
// FIXME: When this algorithm changes, update
- // LayerTreeHost::prioritizeTextures() accordingly.
+ // LayerTreeHost::PrioritizeTextures() accordingly.
const WebKit::WebFilterOperations& filters = quad->background_filters;
- if (filters.isEmpty())
- return scoped_ptr<ScopedResource>();
+ DCHECK(!filters.isEmpty());
// FIXME: We only allow background filters on an opaque render surface because
// other surfaces may contain translucent pixels, and the contents behind
@@ -662,11 +661,23 @@ void GLRenderer::DrawRenderPassQuad(DrawingFrame* frame,
if (!contents_device_transform.GetInverse(&contents_device_transform_inverse))
return;
- scoped_ptr<ScopedResource> background_texture =
- DrawBackgroundFilters(frame,
- quad,
- contents_device_transform,
- contents_device_transform_inverse);
+ scoped_ptr<ScopedResource> background_texture;
+ if (!quad->background_filters.isEmpty()) {
+ // The pixels from the filtered background should completely replace the
+ // current pixel values.
+ bool disable_blending = blend_enabled();
+ if (disable_blending)
+ SetBlendEnabled(false);
+
+ background_texture = DrawBackgroundFilters(
+ frame,
+ quad,
+ contents_device_transform,
+ contents_device_transform_inverse);
+
+ if (disable_blending)
+ SetBlendEnabled(true);
+ }
// FIXME: Cache this value so that we don't have to do it for both the surface
// and its replica. Apply filters to the contents texture.
« no previous file with comments | « cc/output/gl_renderer.h ('k') | cc/test/layer_tree_pixel_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698