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

Unified Diff: src/gpu/GrLayerHoister.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/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrLayerHoister.cpp
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index 2c45a7f9e55a008532cc89a26d5cb9c51489bb16..842ab56dfbdd1c84d09206a27f4216043af2963e 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -12,7 +12,6 @@
#include "SkBigPicture.h"
#include "SkCanvas.h"
#include "SkGpuDevice.h"
-#include "SkGrPixelRef.h"
#include "SkLayerInfo.h"
#include "SkRecordDraw.h"
#include "SkSurface.h"
@@ -277,15 +276,6 @@ void GrLayerHoister::DrawLayersToAtlas(GrContext* context,
}
}
-SkBitmap wrap_texture(GrTexture* texture) {
- SkASSERT(texture);
-
- SkBitmap result;
- result.setInfo(texture->surfacePriv().info(kPremul_SkAlphaType));
- result.setPixelRef(new SkGrPixelRef(result.info(), texture))->unref();
- return result;
-}
-
void GrLayerHoister::FilterLayer(GrContext* context,
SkGpuDevice* device,
const GrHoistedLayer& info) {
@@ -314,7 +304,9 @@ void GrLayerHoister::FilterLayer(GrContext* context,
SkImageFilter::Context filterContext(totMat, clipBounds, cache);
SkImageFilter::DeviceProxy proxy(device);
- const SkBitmap src = wrap_texture(layer->texture());
+ SkBitmap src;
+ GrWrapTextureInBitmap(layer->texture(), layer->texture()->width(), layer->texture()->height(),
+ false, &src);
if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitmap, &offset)) {
// Filtering failed. Press on with the unfiltered version.
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrRecordReplaceDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698