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

Side by Side Diff: src/core/SkImageFilter.cpp

Issue 611383003: Revert of GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 GrContext::AutoWideOpenIdentityDraw awoid(context, NULL); 392 GrContext::AutoWideOpenIdentityDraw awoid(context, NULL);
393 if (this->canFilterImageGPU()) { 393 if (this->canFilterImageGPU()) {
394 return this->filterImageGPU(proxy, src, ctx, result, offset); 394 return this->filterImageGPU(proxy, src, ctx, result, offset);
395 } else { 395 } else {
396 if (this->filterImage(proxy, src, ctx, result, offset)) { 396 if (this->filterImage(proxy, src, ctx, result, offset)) {
397 if (!result->getTexture()) { 397 if (!result->getTexture()) {
398 const SkImageInfo info = result->info(); 398 const SkImageInfo info = result->info();
399 if (kUnknown_SkColorType == info.colorType()) { 399 if (kUnknown_SkColorType == info.colorType()) {
400 return false; 400 return false;
401 } 401 }
402 SkAutoTUnref<GrTexture> resultTex(GrRefCachedBitmapTexture(conte xt, *result, NULL)); 402 GrTexture* resultTex = GrLockAndRefCachedBitmapTexture(context, *result, NULL);
403 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, resultTex))) ->unref(); 403 result->setPixelRef(new SkGrPixelRef(info, resultTex))->unref();
404 GrUnlockAndUnrefCachedBitmapTexture(resultTex);
404 } 405 }
405 return true; 406 return true;
406 } else { 407 } else {
407 return false; 408 return false;
408 } 409 }
409 } 410 }
410 } 411 }
411 #endif 412 #endif
412 413
413 namespace { 414 namespace {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 } // namespace 493 } // namespace
493 494
494 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) { 495 SkImageFilter::Cache* SkImageFilter::Cache::Create(size_t maxBytes) {
495 return SkNEW_ARGS(CacheImpl, (maxBytes)); 496 return SkNEW_ARGS(CacheImpl, (maxBytes));
496 } 497 }
497 498
498 SkImageFilter::Cache* SkImageFilter::Cache::Get() { 499 SkImageFilter::Cache* SkImageFilter::Cache::Get() {
499 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache); 500 SK_DECLARE_STATIC_LAZY_PTR(SkImageFilter::Cache, cache, CreateCache);
500 return cache.get(); 501 return cache.get();
501 } 502 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698