diff options
author | 2016-01-14 06:03:29 -0800 | |
---|---|---|
committer | 2016-01-14 06:03:29 -0800 | |
commit | 1de87df0b743e30619b8ba93ab0169fd41d0feae (patch) | |
tree | e6c2230c8a2922586e683035997864ebc2adc640 /src/gpu/SkGpuDevice.cpp | |
parent | abc0c8216b8e162b8de74de005f883cb84bd254b (diff) |
Refactor to use GrWrapTextureInBitmap more
Too many wrap_texture methods!
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584933002
Review URL: https://codereview.chromium.org/1584933002
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 5de1000085..a3f00c1434 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -641,13 +641,6 @@ void SkGpuDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint /////////////////////////////////////////////////////////////////////////////// -static SkBitmap wrap_texture(GrTexture* texture, int width, int height) { - SkBitmap result; - result.setInfo(SkImageInfo::MakeN32Premul(width, height)); - result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref(); - return result; -} - void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, const SkPaint& paint, const SkMatrix* prePathMatrix, bool pathIsMutable) { @@ -1139,8 +1132,9 @@ bool SkGpuDevice::filterTexture(GrContext* context, GrTexture* texture, SkImageFilter::DeviceProxy proxy(this); if (filter->canFilterImageGPU()) { - return filter->filterImageGPU(&proxy, wrap_texture(texture, width, height), - ctx, result, offset); + SkBitmap bm; + GrWrapTextureInBitmap(texture, width, height, false, &bm); + return filter->filterImageGPU(&proxy, bm, ctx, result, offset); } else { return false; } |