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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 1507973005: Make "alpha only" be a property of GrTextureProducer (Closed) Base URL: https://skia.googlesource.com/skia.git@producernine
Patch Set: fix unused var Created 5 years 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/gpu/SkGpuDevice_drawTexture.cpp ('k') | no next file » | 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 55a82bba8701b86e059fd7283f73941bf55d4911..e773aed9484d4d0c7a7d552ce94bfb471d068d87 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -8,7 +8,7 @@
#include "GrCaps.h"
#include "GrContext.h"
#include "GrDrawContext.h"
-#include "GrTextureParamsAdjuster.h"
+#include "GrImageIDTextureAdjuster.h"
#include "effects/GrYUVtoRGBEffect.h"
#include "SkCanvas.h"
#include "SkBitmapCache.h"
@@ -78,31 +78,8 @@ bool SkImage_Gpu::asBitmapForImageFilters(SkBitmap* bitmap) const {
return true;
}
-class GpuImage_GrTextureAdjuster : public GrTextureAdjuster {
-public:
- GpuImage_GrTextureAdjuster(const SkImage_Gpu* image)
- : INHERITED(image->peekTexture())
- , fImage(image)
- {}
-
-protected:
- void makeCopyKey(const CopyParams& params, GrUniqueKey* copyKey) override {
- GrUniqueKey baseKey;
- GrMakeKeyFromImageID(&baseKey, fImage->uniqueID(),
- SkIRect::MakeWH(fImage->width(), fImage->height()));
- MakeCopyKeyFromOrigKey(baseKey, params, copyKey);
- }
-
- void didCacheCopy(const GrUniqueKey& copyKey) override { as_IB(fImage)->notifyAddedToCache(); }
-
-private:
- const SkImage* fImage;
-
- typedef GrTextureAdjuster INHERITED;
-};
-
GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, const GrTextureParams& params) const {
- return GpuImage_GrTextureAdjuster(this).refTextureSafeForParams(params, nullptr);
+ return GrImageTextureAdjuster(as_IB(this)).refTextureSafeForParams(params, nullptr);
}
bool SkImage_Gpu::isOpaque() const {
« no previous file with comments | « src/gpu/SkGpuDevice_drawTexture.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698