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

Unified Diff: Source/platform/graphics/BitmapPattern.cpp

Issue 1008243003: Nuke NativeImageSkia -- new version. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add more WARN_UNUSED_RETURN goodness Created 5 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 | « Source/platform/graphics/BitmapPattern.h ('k') | Source/platform/graphics/BitmapPatternBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/BitmapPattern.cpp
diff --git a/Source/platform/graphics/BitmapPattern.cpp b/Source/platform/graphics/BitmapPattern.cpp
index fc02b1c0cd258cd3482f296a87205aab7ee530b6..41a1c37c655e039b04dfef947bb008f606a0bb60 100644
--- a/Source/platform/graphics/BitmapPattern.cpp
+++ b/Source/platform/graphics/BitmapPattern.cpp
@@ -16,23 +16,21 @@ BitmapPattern::BitmapPattern(PassRefPtr<Image> image, RepeatMode repeatMode)
{
if (image) {
// If image is animated, what about the pattern?
- m_tileImage = image->nativeImageForCurrentFrame();
-
- if (m_tileImage)
- adjustExternalMemoryAllocated(m_tileImage->bitmap().getSafeSize());
+ if (image->bitmapForCurrentFrame(&m_tileImage))
+ adjustExternalMemoryAllocated(m_tileImage.getSafeSize());
}
}
PassRefPtr<SkShader> BitmapPattern::createShader()
{
- if (!m_tileImage) {
+ if (m_tileImage.isNull()) {
return adoptRef(SkShader::CreateColorShader(SK_ColorTRANSPARENT));
}
SkMatrix localMatrix = affineTransformToSkMatrix(m_patternSpaceTransformation);
if (isRepeatXY()) {
- return adoptRef(SkShader::CreateBitmapShader(m_tileImage->bitmap(), SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
+ return adoptRef(SkShader::CreateBitmapShader(m_tileImage, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix));
}
return BitmapPatternBase::createShader();
@@ -40,12 +38,12 @@ PassRefPtr<SkShader> BitmapPattern::createShader()
SkImageInfo BitmapPattern::getBitmapInfo()
{
- return m_tileImage->bitmap().info();
+ return m_tileImage.info();
}
void BitmapPattern::drawBitmapToCanvas(SkCanvas& canvas, SkPaint& paint)
{
- canvas.drawBitmap(m_tileImage->bitmap(), SkIntToScalar(0), SkIntToScalar(0), &paint);
+ canvas.drawBitmap(m_tileImage, SkIntToScalar(0), SkIntToScalar(0), &paint);
}
} // namespace
« no previous file with comments | « Source/platform/graphics/BitmapPattern.h ('k') | Source/platform/graphics/BitmapPatternBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698