diff options
author | fmalita <fmalita@chromium.org> | 2015-09-24 07:25:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-24 14:26:30 +0000 |
commit | f061313ea1d8fbb58c3d1fa8577ad42859c6f08f (patch) | |
tree | 0a5c65235b2c8d69f3d63690b3566d941136adc7 | |
parent | 05b36cbc152ad45eb9db6255aeb947e2c0cb4805 (diff) | |
download | chromium_src-f061313ea1d8fbb58c3d1fa8577ad42859c6f08f.zip chromium_src-f061313ea1d8fbb58c3d1fa8577ad42859c6f08f.tar.gz chromium_src-f061313ea1d8fbb58c3d1fa8577ad42859c6f08f.tar.bz2 |
Switch SkImage::newImage() clients to the newSubset() API
SkImage::newImage() is being deprecated, and we're only using it for
subsetting => convert existing users to newSubset().
R=reed@google.com
Review URL: https://codereview.chromium.org/1369493002
Cr-Commit-Position: refs/heads/master@{#350549}
-rw-r--r-- | skia/config/SkUserConfig.h | 4 | ||||
-rw-r--r-- | third_party/WebKit/Source/core/frame/ImageBitmap.cpp | 3 | ||||
-rw-r--r-- | third_party/WebKit/Source/platform/graphics/Image.cpp | 3 |
3 files changed, 2 insertions, 8 deletions
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index df966f2..ef74202 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h @@ -226,10 +226,6 @@ SK_API void SkDebugf_FileLine(const char* file, int line, bool fatal, # define SK_SAVE_LAYER_BOUNDS_ARE_FILTERED #endif -#ifndef SK_SUPPORT_LEGACY_NEWIMAGE -# define SK_SUPPORT_LEGACY_NEWIMAGE -#endif - ///////////////////////// Imported from BUILD.gn and skia_common.gypi /* In some places Skia can use static initializers for global initialization, diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp index 5349544..71b11d6 100644 --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp @@ -37,8 +37,7 @@ static inline PassRefPtr<Image> cropImage(PassRefPtr<Image> image, const IntRect if (!skImage) return nullptr; - return StaticBitmapImage::create(adoptRef( - skImage->newImage(srcRect.width(), srcRect.height(), &srcRect))); + return StaticBitmapImage::create(adoptRef(skImage->newSubset(srcRect))); } ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect) diff --git a/third_party/WebKit/Source/platform/graphics/Image.cpp b/third_party/WebKit/Source/platform/graphics/Image.cpp index 2d274af..8b83d53 100644 --- a/third_party/WebKit/Source/platform/graphics/Image.cpp +++ b/third_party/WebKit/Source/platform/graphics/Image.cpp @@ -240,8 +240,7 @@ void Image::drawPattern(GraphicsContext* context, const FloatRect& floatSrcRect, // Fetch this now as subsetting may swap the image. auto imageID = image->uniqueID(); - SkIRect srcRect = enclosingIntRect(normSrcRect); - image = adoptRef(image->newImage(srcRect.width(), srcRect.height(), &srcRect)); + image = adoptRef(image->newSubset(enclosingIntRect(normSrcRect))); if (!image) return; |