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

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

Issue 1571033002: remove imagefilter::sizeconstraint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 SkIntToScalar(bounds.height())); 376 SkIntToScalar(bounds.height()));
377 GrTexture* srcTexture = input.getTexture(); 377 GrTexture* srcTexture = input.getTexture();
378 GrContext* context = srcTexture->getContext(); 378 GrContext* context = srcTexture->getContext();
379 379
380 GrSurfaceDesc desc; 380 GrSurfaceDesc desc;
381 desc.fFlags = kRenderTarget_GrSurfaceFlag, 381 desc.fFlags = kRenderTarget_GrSurfaceFlag,
382 desc.fWidth = bounds.width(); 382 desc.fWidth = bounds.width();
383 desc.fHeight = bounds.height(); 383 desc.fHeight = bounds.height();
384 desc.fConfig = kRGBA_8888_GrPixelConfig; 384 desc.fConfig = kRGBA_8888_GrPixelConfig;
385 385
386 auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint()); 386 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture( desc));
387 SkAutoTUnref<GrTexture> dst(context->textureProvider()->createTexture(desc, constraint));
388 if (!dst) { 387 if (!dst) {
389 return false; 388 return false;
390 } 389 }
391 390
392 // setup new clip 391 // setup new clip
393 GrClip clip(dstRect); 392 GrClip clip(dstRect);
394 393
395 offset->fX = bounds.left(); 394 offset->fX = bounds.left();
396 offset->fY = bounds.top(); 395 offset->fY = bounds.top();
397 SkMatrix matrix(ctx.ctm()); 396 SkMatrix matrix(ctx.ctm());
(...skipping 1636 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2033
2035 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2034 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2036 } 2035 }
2037 2036
2038 #endif 2037 #endif
2039 2038
2040 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2039 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2041 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2040 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2042 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2041 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2043 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2042 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