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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1584933002: Refactor to use GrWrapTextureInBitmap more (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build Created 4 years, 11 months 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/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 5de10000857fddbedc6298d341e0112aab87a973..a3f00c1434f43f504d1cae0acf27cb77971169a7 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;
}
« no previous file with comments | « src/gpu/GrRecordReplaceDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698