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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 1463373002: scaling API on SkPixmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « src/image/SkImage_Gpu.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index dd4bee311d0a864109af766e33d05eaf67dfd74f..346f7983b71eff2838ebf132c44111554fd24048 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -45,7 +45,7 @@ static SkImageInfo make_info(int w, int h, bool isOpaque) {
return SkImageInfo::MakeN32(w, h, isOpaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
}
-bool SkImage_Gpu::getROPixels(SkBitmap* dst) const {
+bool SkImage_Gpu::getROPixels(SkBitmap* dst, CachingHint chint) const {
if (SkBitmapCache::Find(this->uniqueID(), dst)) {
SkASSERT(dst->getGenerationID() == this->uniqueID());
SkASSERT(dst->isImmutable());
@@ -62,8 +62,10 @@ bool SkImage_Gpu::getROPixels(SkBitmap* dst) const {
}
dst->pixelRef()->setImmutableWithID(this->uniqueID());
- SkBitmapCache::Add(this->uniqueID(), *dst);
- fAddedRasterVersionToCache.store(true);
+ if (kAllow_CachingHint == chint) {
+ SkBitmapCache::Add(this->uniqueID(), *dst);
+ fAddedRasterVersionToCache.store(true);
+ }
return true;
}
@@ -120,7 +122,7 @@ static void apply_premul(const SkImageInfo& info, void* pixels, size_t rowBytes)
}
bool SkImage_Gpu::onReadPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- int srcX, int srcY) const {
+ int srcX, int srcY, CachingHint) const {
GrPixelConfig config = SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(),
info.profileType());
uint32_t flags = 0;
« no previous file with comments | « src/image/SkImage_Gpu.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698