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

Unified Diff: src/image/SkImage_Generator.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_Base.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Generator.cpp
diff --git a/src/image/SkImage_Generator.cpp b/src/image/SkImage_Generator.cpp
index 346528939ab67b88e52cb1cd646119078ae1a4b6..5031c24548118b747c3251232cd35b1e0ca8691b 100644
--- a/src/image/SkImage_Generator.cpp
+++ b/src/image/SkImage_Generator.cpp
@@ -21,12 +21,12 @@ public:
, fCache(cache) // take ownership
{}
- bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY) const override;
+ bool onReadPixels(const SkImageInfo&, void*, size_t, int srcX, int srcY, CachingHint) const override;
const void* onPeekPixels(SkImageInfo*, size_t* /*rowBytes*/) const override;
SkData* onRefEncoded() const override;
bool isOpaque() const override { return fCache->info().isOpaque(); }
SkImage* onNewSubset(const SkIRect&) const override;
- bool getROPixels(SkBitmap*) const override;
+ bool getROPixels(SkBitmap*, CachingHint) const override;
GrTexture* asTextureRef(GrContext*, const GrTextureParams&) const override;
bool onIsLazyGenerated() const override { return true; }
@@ -39,9 +39,9 @@ private:
///////////////////////////////////////////////////////////////////////////////
bool SkImage_Generator::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRB,
- int srcX, int srcY) const {
+ int srcX, int srcY, CachingHint chint) const {
SkBitmap bm;
- if (this->getROPixels(&bm)) {
+ if (this->getROPixels(&bm, chint)) {
return bm.readPixels(dstInfo, dstPixels, dstRB, srcX, srcY);
}
return false;
@@ -55,8 +55,8 @@ SkData* SkImage_Generator::onRefEncoded() const {
return fCache->refEncoded();
}
-bool SkImage_Generator::getROPixels(SkBitmap* bitmap) const {
- return fCache->lockAsBitmap(bitmap, this);
+bool SkImage_Generator::getROPixels(SkBitmap* bitmap, CachingHint chint) const {
+ return fCache->lockAsBitmap(bitmap, this, chint);
}
GrTexture* SkImage_Generator::asTextureRef(GrContext* ctx, const GrTextureParams& params) const {
« no previous file with comments | « src/image/SkImage_Base.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698