diff options
author | 2017-01-20 12:44:06 -0500 | |
---|---|---|
committer | 2017-01-20 18:18:18 +0000 | |
commit | 67c18d6b5188a0497f6912a73d964c763d2f8f84 (patch) | |
tree | d32888c6b13589c2718fc6673f29acf2bb546c38 /src/image/SkImage_Raster.cpp | |
parent | 41398f430dc501d450e04540a83b6aa5baf87cd7 (diff) |
Continue making Ganesh use absolute texture coordinates - take 2
The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix)
Relanding of: https://skia-review.googlesource.com/c/6977/
Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02
Reviewed-on: https://skia-review.googlesource.com/7265
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/image/SkImage_Raster.cpp')
-rw-r--r-- | src/image/SkImage_Raster.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index cce1ed20c5..b287789ea8 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -89,7 +89,7 @@ public: bool getROPixels(SkBitmap*, SkColorSpace* dstColorSpace, CachingHint) const override; GrTexture* asTextureRef(GrContext*, const GrSamplerParams&, SkColorSpace*, - sk_sp<SkColorSpace>*) const override; + sk_sp<SkColorSpace>*, SkScalar scaleAdjust[2]) const override; sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } @@ -173,7 +173,8 @@ bool SkImage_Raster::getROPixels(SkBitmap* dst, SkColorSpace* dstColorSpace, Cac GrTexture* SkImage_Raster::asTextureRef(GrContext* ctx, const GrSamplerParams& params, SkColorSpace* dstColorSpace, - sk_sp<SkColorSpace>* texColorSpace) const { + sk_sp<SkColorSpace>* texColorSpace, + SkScalar scaleAdjust[2]) const { #if SK_SUPPORT_GPU if (!ctx) { return nullptr; @@ -188,10 +189,10 @@ GrTexture* SkImage_Raster::asTextureRef(GrContext* ctx, const GrSamplerParams& p if (tex) { GrTextureAdjuster adjuster(fPinnedTexture.get(), fBitmap.alphaType(), fBitmap.bounds(), fPinnedUniqueID, fBitmap.colorSpace()); - return adjuster.refTextureSafeForParams(params, nullptr); + return adjuster.refTextureSafeForParams(params, nullptr, scaleAdjust); } - return GrRefCachedBitmapTexture(ctx, fBitmap, params); + return GrRefCachedBitmapTexture(ctx, fBitmap, params, scaleAdjust); #endif return nullptr; @@ -218,7 +219,7 @@ bool SkImage_Raster::onPinAsTexture(GrContext* ctx) const { SkASSERT(fPinnedCount == 0); SkASSERT(fPinnedUniqueID == 0); fPinnedTexture.reset( - GrRefCachedBitmapTexture(ctx, fBitmap, GrSamplerParams::ClampNoFilter())); + GrRefCachedBitmapTexture(ctx, fBitmap, GrSamplerParams::ClampNoFilter(), nullptr)); if (!fPinnedTexture) { return false; } |