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

Unified Diff: src/core/SkImageFilterUtils.cpp

Issue 185973003: Cleanup patch to move all of SkImageFilterUtils into SkImageFilter. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Oh, the Rietveld suckage Created 6 years, 10 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/core/SkImageFilter.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilterUtils.cpp
diff --git a/src/core/SkImageFilterUtils.cpp b/src/core/SkImageFilterUtils.cpp
deleted file mode 100644
index c6c534e71dfcfd93c4d2229e41e19219fcfd7f9b..0000000000000000000000000000000000000000
--- a/src/core/SkImageFilterUtils.cpp
+++ /dev/null
@@ -1,55 +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) {
- SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- result->setConfig(info);
- result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
- return true;
-}
-
-bool SkImageFilterUtils::GetInputResultGPU(const SkImageFilter* filter, SkImageFilter::Proxy* proxy,
- const SkBitmap& src, const SkMatrix& ctm,
- SkBitmap* result, SkIPoint* offset) {
- // Ensure that GrContext calls under filterImage and filterImageGPU below will see an identity
- // matrix with no clip and that the matrix, clip, and render target set before this function was
- // called are restored before we return to the caller.
- GrContext* context = src.getTexture()->getContext();
- GrContext::AutoWideOpenIdentityDraw awoid(context, NULL);
- if (!filter) {
- offset->fX = offset->fY = 0;
- *result = src;
- return true;
- } else if (filter->canFilterImageGPU()) {
- return filter->filterImageGPU(proxy, src, ctm, result, offset);
- } else {
- if (filter->filterImage(proxy, src, ctm, result, offset)) {
- if (!result->getTexture()) {
- SkImageInfo info;
- if (!result->asImageInfo(&info)) {
- return false;
- }
- GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context, *result, NULL);
- result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
- GrUnlockAndUnrefCachedBitmapTexture(resultTex);
- }
- return true;
- } else {
- return false;
- }
- }
-}
-#endif
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698