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

Unified Diff: third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp

Issue 2559013002: Add ColorBehavior to blink::Image draw methods (Closed)
Patch Set: Rebase Created 4 years 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
Index: third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
index 203bfc86a0b09db86a76ab7528eb7b57b0edf9f6..d8d0834bb8ca17410034938dfa4944724e66159e 100644
--- a/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GradientGeneratedImage.cpp
@@ -36,7 +36,10 @@ void GradientGeneratedImage::draw(SkCanvas* canvas,
const FloatRect& destRect,
const FloatRect& srcRect,
RespectImageOrientationEnum,
- ImageClampingMode) {
+ ImageClampingMode,
+ const ColorBehavior& colorBehavior) {
+ // TODO(ccameron): This function should not ignore |colorBehavior|.
+ // https://crbug.com/672306
SkRect visibleSrcRect = srcRect;
if (!visibleSrcRect.intersect(
SkRect::MakeIWH(m_size.width(), m_size.height())))
@@ -54,6 +57,8 @@ void GradientGeneratedImage::draw(SkCanvas* canvas,
void GradientGeneratedImage::drawTile(GraphicsContext& context,
const FloatRect& srcRect) {
+ // TODO(ccameron): This function should not ignore |context|'s color behavior.
+ // https://crbug.com/672306
SkPaint gradientPaint(context.fillPaint());
m_gradient->applyToPaint(gradientPaint, SkMatrix::I());
@@ -61,7 +66,10 @@ void GradientGeneratedImage::drawTile(GraphicsContext& context,
}
bool GradientGeneratedImage::applyShader(SkPaint& paint,
- const SkMatrix& localMatrix) {
+ const SkMatrix& localMatrix,
+ const ColorBehavior& colorBehavior) {
+ // TODO(ccameron): This function should not ignore |colorBehavior|.
+ // https://crbug.com/672306
DCHECK(m_gradient);
m_gradient->applyToPaint(paint, localMatrix);

Powered by Google App Engine
This is Rietveld 408576698