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

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

Issue 1471053002: Don't create a GXPFactory when blend is SrcOver (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix compile 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/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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 GrTexture* src, 347 GrTexture* src,
348 const SkMatrix& matrix, 348 const SkMatrix& matrix,
349 const GrClip& clip, 349 const GrClip& clip,
350 const SkRect& dstRect, 350 const SkRect& dstRect,
351 BoundaryMode boundaryMode, 351 BoundaryMode boundaryMode,
352 const SkIRect& bounds) const { 352 const SkIRect& bounds) const {
353 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y())); 353 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y()));
354 GrPaint paint; 354 GrPaint paint;
355 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, bo undaryMode); 355 GrFragmentProcessor* fp = this->getFragmentProcessor(src, matrix, bounds, bo undaryMode);
356 paint.addColorFragmentProcessor(fp)->unref(); 356 paint.addColorFragmentProcessor(fp)->unref();
357 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
357 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); 358 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
358 } 359 }
359 360
360 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy, 361 bool SkLightingImageFilterInternal::filterImageGPU(Proxy* proxy,
361 const SkBitmap& src, 362 const SkBitmap& src,
362 const Context& ctx, 363 const Context& ctx,
363 SkBitmap* result, 364 SkBitmap* result,
364 SkIPoint* offset) const { 365 SkIPoint* offset) const {
365 SkBitmap input = src; 366 SkBitmap input = src;
366 SkIPoint srcOffset = SkIPoint::Make(0, 0); 367 SkIPoint srcOffset = SkIPoint::Make(0, 0);
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2028 2029
2029 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2030 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2030 } 2031 }
2031 2032
2032 #endif 2033 #endif
2033 2034
2034 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2035 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2035 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2036 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2036 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2037 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2037 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2038 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