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

Side by Side Diff: src/effects/SkLightingImageFilter.cpp

Issue 1107973004: Pull cache out of GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixpicturerenderer.cpp Created 5 years, 7 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/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkMorphologyImageFilter.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 "SkLightingImageFilter.h" 8 #include "SkLightingImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 SkIntToScalar(bounds.height())); 358 SkIntToScalar(bounds.height()));
359 GrTexture* srcTexture = input.getTexture(); 359 GrTexture* srcTexture = input.getTexture();
360 GrContext* context = srcTexture->getContext(); 360 GrContext* context = srcTexture->getContext();
361 361
362 GrSurfaceDesc desc; 362 GrSurfaceDesc desc;
363 desc.fFlags = kRenderTarget_GrSurfaceFlag, 363 desc.fFlags = kRenderTarget_GrSurfaceFlag,
364 desc.fWidth = bounds.width(); 364 desc.fWidth = bounds.width();
365 desc.fHeight = bounds.height(); 365 desc.fHeight = bounds.height();
366 desc.fConfig = kRGBA_8888_GrPixelConfig; 366 desc.fConfig = kRGBA_8888_GrPixelConfig;
367 367
368 SkAutoTUnref<GrTexture> dst( 368 SkAutoTUnref<GrTexture> dst(context->textureProvider()->refScratchTexture(de sc,
369 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); 369 GrTextureProvider::kApprox_ScratchTexMatch));
370 if (!dst) { 370 if (!dst) {
371 return false; 371 return false;
372 } 372 }
373 373
374 // setup new clip 374 // setup new clip
375 GrClip clip(dstRect); 375 GrClip clip(dstRect);
376 376
377 offset->fX = bounds.left(); 377 offset->fX = bounds.left();
378 offset->fY = bounds.top(); 378 offset->fY = bounds.top();
379 SkMatrix matrix(ctx.ctm()); 379 SkMatrix matrix(ctx.ctm());
(...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 1986
1987 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1987 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1988 } 1988 }
1989 1989
1990 #endif 1990 #endif
1991 1991
1992 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1992 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1993 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1993 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1994 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1995 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1995 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698