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

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

Issue 1412863006: Fix some GPU filters to use the correct size constraint. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 SkIntToScalar(bounds.height())); 373 SkIntToScalar(bounds.height()));
374 GrTexture* srcTexture = input.getTexture(); 374 GrTexture* srcTexture = input.getTexture();
375 GrContext* context = srcTexture->getContext(); 375 GrContext* context = srcTexture->getContext();
376 376
377 GrSurfaceDesc desc; 377 GrSurfaceDesc desc;
378 desc.fFlags = kRenderTarget_GrSurfaceFlag, 378 desc.fFlags = kRenderTarget_GrSurfaceFlag,
379 desc.fWidth = bounds.width(); 379 desc.fWidth = bounds.width();
380 desc.fHeight = bounds.height(); 380 desc.fHeight = bounds.height();
381 desc.fConfig = kRGBA_8888_GrPixelConfig; 381 desc.fConfig = kRGBA_8888_GrPixelConfig;
382 382
383 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture( desc)); 383 auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint());
384 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createTexture(desc, constraint));
384 if (!dst) { 385 if (!dst) {
385 return false; 386 return false;
386 } 387 }
387 388
388 // setup new clip 389 // setup new clip
389 GrClip clip(dstRect); 390 GrClip clip(dstRect);
390 391
391 offset->fX = bounds.left(); 392 offset->fX = bounds.left();
392 offset->fY = bounds.top(); 393 offset->fY = bounds.top();
393 SkMatrix matrix(ctx.ctm()); 394 SkMatrix matrix(ctx.ctm());
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
2011 2012
2012 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2013 fsBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2013 } 2014 }
2014 2015
2015 #endif 2016 #endif
2016 2017
2017 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2018 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2018 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2019 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2019 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2020 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2020 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2021 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698