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

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

Issue 1949253004: Rounded background image fast path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 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
Index: third_party/WebKit/Source/platform/graphics/Image.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp
index bcefc90b344770a2a778facfb82707b42bc8b3a5..21205cf4ff49aa335608275f949cba3bdca724e3 100644
--- a/third_party/WebKit/Source/platform/graphics/Image.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -270,4 +270,17 @@ bool Image::isTextureBacked()
return image ? image->isTextureBacked() : false;
}
+bool Image::applyShader(SkPaint& paint, const SkMatrix* localMatrix)
+{
+ // Default shader impl: attempt to build a shader based on the current frame SkImage.
+ RefPtr<SkImage> image = imageForCurrentFrame();
+ if (!image)
+ return false;
+
+ paint.setShader(
+ image->makeShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, localMatrix));
+
+ return true;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698