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

Unified Diff: src/gpu/GrLayerHoister.cpp

Issue 851773002: Revert of Switch to a more complete method of filtering hoisted layers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/GrLayerCache.h ('k') | no next file » | 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 3bb7b2e2fd2364b4759ddf84dee9935bc7380a94..7d6f5ab1b3879b4f1648d459ec6bc3111405622c 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -10,8 +10,6 @@
#include "GrRecordReplaceDraw.h"
#include "SkCanvas.h"
-#include "SkDeviceImageFilterProxy.h"
-#include "SkDeviceProperties.h"
#include "SkGpuDevice.h"
#include "SkGrPixelRef.h"
#include "SkLayerInfo.h"
@@ -276,19 +274,13 @@
}
}
-SkBitmap wrap_texture(GrTexture* texture) {
- SkBitmap result;
- result.setInfo(texture->surfacePriv().info());
- result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (result.info(), texture)))->unref();
- return result;
-}
-
void GrLayerHoister::FilterLayer(GrContext* context,
SkGpuDevice* device,
const GrHoistedLayer& info) {
GrCachedLayer* layer = info.fLayer;
SkASSERT(layer->filter());
+ SkASSERT(layer->filter()->canFilterImageGPU());
static const int kDefaultCacheSize = 32 * 1024 * 1024;
@@ -302,6 +294,7 @@
totMat.preConcat(info.fLocalMat);
totMat.postTranslate(-SkIntToScalar(filterOffset.fX), -SkIntToScalar(filterOffset.fY));
+
SkASSERT(0 == layer->rect().fLeft && 0 == layer->rect().fTop);
SkIRect clipBounds = layer->rect();
@@ -310,11 +303,9 @@
SkAutoTUnref<SkImageFilter::Cache> cache(SkImageFilter::Cache::Create(kDefaultCacheSize));
SkImageFilter::Context filterContext(totMat, clipBounds, cache);
- SkDeviceImageFilterProxy proxy(device, SkSurfaceProps(0, kUnknown_SkPixelGeometry));
- const SkBitmap src = wrap_texture(layer->texture());
-
- if (!layer->filter()->filterImage(&proxy, src, filterContext, &filteredBitmap, &offset)) {
- // Filtering failed. Press on with the unfiltered version.
+ if (!device->filterTexture(context, layer->texture(), layer->filter(),
+ filterContext, &filteredBitmap, &offset)) {
+ // Filtering failed. Press on with the unfiltered version
return;
}
« no previous file with comments | « src/gpu/GrLayerCache.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698