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

Unified Diff: src/effects/SkImageFilterUtils.cpp

Issue 13602013: Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This w… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix return value of SkImageFilter::asNewEffect(). Created 7 years, 8 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
Index: src/effects/SkImageFilterUtils.cpp
diff --git a/src/effects/SkImageFilterUtils.cpp b/src/effects/SkImageFilterUtils.cpp
deleted file mode 100644
index 2dfb33d73cdd777469767c20a013168954953206..0000000000000000000000000000000000000000
--- a/src/effects/SkImageFilterUtils.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2013 The Android Open Source Project
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkMatrix.h"
-
-#if SK_SUPPORT_GPU
-#include "GrTexture.h"
-#include "SkImageFilterUtils.h"
-#include "SkBitmap.h"
-#include "SkGrPixelRef.h"
-#include "SkGr.h"
-
-bool SkImageFilterUtils::WrapTexture(GrTexture* texture, int width, int height, SkBitmap* result) {
- SkASSERT(texture->config() == kSkia8888_GrPixelConfig);
- result->setConfig(SkBitmap::kARGB_8888_Config, width, height);
- result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (texture)))->unref();
- return true;
-}
-
-bool SkImageFilterUtils::GetInputResultGPU(SkImageFilter* filter, SkImageFilter::Proxy* proxy, const SkBitmap& src, SkBitmap* result) {
- if (!filter) {
- *result = src;
- return true;
- } else if (filter->canFilterImageGPU()) {
- return filter->filterImageGPU(proxy, src, result);
- } else {
- SkIPoint offset;
- if (filter->filterImage(proxy, src, SkMatrix(), result, &offset)) {
- if (!result->getTexture()) {
- GrContext* context = ((GrTexture *) src.getTexture())->getContext();
- GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context,
- *result, NULL);
- result->setPixelRef(new SkGrPixelRef(resultTex))->unref();
- GrUnlockAndUnrefCachedBitmapTexture(resultTex);
- }
- return true;
- } else {
- return false;
- }
- }
-}
-#endif

Powered by Google App Engine
This is Rietveld 408576698