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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2629083003: Fix box shadow rendering on opaque WebGL canvases (Closed)
Patch Set: fixed tests Created 3 years, 11 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 | « third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-shadow-no-alpha-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 1f83e59568c8905a63f85db0f942de8d48212ff8..57091efd08f57fd8180c2f4a10092d3ea423c7c8 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -391,17 +391,25 @@ void CompositedLayerMapping::
void CompositedLayerMapping::updateContentsOpaque() {
if (isAcceleratedCanvas(layoutObject())) {
- // Determine whether the rendering context's external texture layer is
- // opaque.
CanvasRenderingContext* context =
toHTMLCanvasElement(layoutObject()->node())->renderingContext();
- if (!context->creationAttributes().alpha())
- m_graphicsLayer->setContentsOpaque(true);
- else if (WebLayer* layer = context->platformLayer())
- m_graphicsLayer->setContentsOpaque(
- !Color(layer->backgroundColor()).hasAlpha());
- else
+ WebLayer* layer = context ? context->platformLayer() : nullptr;
+ // Determine whether the external texture layer covers the whole graphics
+ // layer. This may not be the case if there are box decorations or
+ // shadows.
+ if (layer &&
+ layer->bounds() == m_graphicsLayer->platformLayer()->bounds()) {
+ // Determine whether the rendering context's external texture layer is
+ // opaque.
+ if (!context->creationAttributes().alpha()) {
+ m_graphicsLayer->setContentsOpaque(true);
+ } else {
+ m_graphicsLayer->setContentsOpaque(
+ !Color(layer->backgroundColor()).hasAlpha());
+ }
+ } else {
m_graphicsLayer->setContentsOpaque(false);
+ }
} else if (m_backgroundLayer) {
m_graphicsLayer->setContentsOpaque(false);
m_backgroundLayer->setContentsOpaque(
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/canvas/webgl/webgl-shadow-no-alpha-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698