Index: src/image/SkImage_Gpu.cpp |
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp |
index 346f7983b71eff2838ebf132c44111554fd24048..55a82bba8701b86e059fd7283f73941bf55d4911 100644 |
--- a/src/image/SkImage_Gpu.cpp |
+++ b/src/image/SkImage_Gpu.cpp |
@@ -5,16 +5,18 @@ |
* found in the LICENSE file. |
*/ |
-#include "SkBitmapCache.h" |
-#include "SkImage_Gpu.h" |
#include "GrCaps.h" |
#include "GrContext.h" |
#include "GrDrawContext.h" |
#include "GrTextureParamsAdjuster.h" |
#include "effects/GrYUVtoRGBEffect.h" |
#include "SkCanvas.h" |
+#include "SkBitmapCache.h" |
#include "SkGpuDevice.h" |
+#include "SkGrPixelRef.h" |
#include "SkGrPriv.h" |
+#include "SkImageFilter.h" |
+#include "SkImage_Gpu.h" |
#include "SkPixelRef.h" |
SkImage_Gpu::SkImage_Gpu(int w, int h, uint32_t uniqueID, SkAlphaType at, GrTexture* tex, |
@@ -69,6 +71,13 @@ bool SkImage_Gpu::getROPixels(SkBitmap* dst, CachingHint chint) const { |
return true; |
} |
+bool SkImage_Gpu::asBitmapForImageFilters(SkBitmap* bitmap) const { |
+ bitmap->setInfo(make_info(this->width(), this->height(), this->isOpaque())); |
+ bitmap->setPixelRef(new SkGrPixelRef(bitmap->info(), fTexture))->unref(); |
+ bitmap->pixelRef()->setImmutableWithID(this->uniqueID()); |
+ return true; |
+} |
+ |
class GpuImage_GrTextureAdjuster : public GrTextureAdjuster { |
public: |
GpuImage_GrTextureAdjuster(const SkImage_Gpu* image) |
@@ -166,9 +175,6 @@ SkImage* SkImage_Gpu::onNewSubset(const SkIRect& subset) const { |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
-#include "SkGrPixelRef.h" |
-#include "SkImageFilter.h" |
- |
class SkGpuImageFilterProxy : public SkImageFilter::Proxy { |
GrContext* fCtx; |