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

Unified Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 15137009: Refactor shadow rendering logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 7 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 | « Source/core/rendering/InlineTextBox.cpp ('k') | Source/core/rendering/svg/SVGRenderingContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 511cfd492e9bc406ae7f8d6dfa4ff6710a203cad..93d58486c0236fc0e09e94c0c3339a0d9877743c 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -31,6 +31,7 @@
#include "core/page/Page.h"
#include "core/page/Settings.h"
#include "core/page/scrolling/ScrollingConstraints.h"
+#include "core/platform/graphics/DrawLooper.h"
#include "core/platform/graphics/GraphicsContextStateSaver.h"
#include "core/platform/graphics/ImageBuffer.h"
#include "core/platform/graphics/Path.h"
@@ -514,7 +515,7 @@ static void applyBoxShadowForBackground(GraphicsContext* context, RenderStyle* s
boxShadow = boxShadow->next();
FloatSize shadowOffset(boxShadow->x(), boxShadow->y());
- context->setShadow(shadowOffset, boxShadow->blur(), boxShadow->color(), style->colorSpace());
+ context->setShadow(shadowOffset, boxShadow->blur(), boxShadow->color(), DrawLooper::ShadowIgnoresAlpha);
}
void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const LayoutRect& rect,
@@ -2376,7 +2377,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
IntSize extraOffset(paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur + 2 * shadowSpread + 1, 0);
shadowOffset -= extraOffset;
fillRect.move(extraOffset);
- context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+ context->setShadow(shadowOffset, shadowBlur, shadowColor, DrawLooper::ShadowIgnoresAlpha);
if (hasBorderRadius) {
RoundedRect rectToClipOut = border;
@@ -2466,7 +2467,7 @@ void RenderBoxModelObject::paintBoxShadow(const PaintInfo& info, const LayoutRec
IntSize extraOffset(2 * paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur - 2 * shadowSpread + 1, 0);
context->translate(extraOffset.width(), extraOffset.height());
shadowOffset -= extraOffset;
- context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
+ context->setShadow(shadowOffset, shadowBlur, shadowColor, DrawLooper::ShadowIgnoresAlpha);
context->fillRectWithRoundedHole(outerRect, roundedHole, fillColor, s->colorSpace());
}
}
« no previous file with comments | « Source/core/rendering/InlineTextBox.cpp ('k') | Source/core/rendering/svg/SVGRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698