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

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

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 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/effects/SkLayerDrawLooper.cpp ('k') | src/effects/SkMergeImageFilter.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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 const SkRect& dstRect, 389 const SkRect& dstRect,
390 BoundaryMode boundaryMode, 390 BoundaryMode boundaryMode,
391 const SkIRect* srcBounds, 391 const SkIRect* srcBounds,
392 const SkIRect& bounds) const { 392 const SkIRect& bounds) const {
393 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y())); 393 SkRect srcRect = dstRect.makeOffset(SkIntToScalar(bounds.x()), SkIntToScalar (bounds.y()));
394 GrPaint paint; 394 GrPaint paint;
395 paint.setGammaCorrect(drawContext->isGammaCorrect()); 395 paint.setGammaCorrect(drawContext->isGammaCorrect());
396 sk_sp<GrFragmentProcessor> fp(this->makeFragmentProcessor(src, matrix, srcBo unds, 396 sk_sp<GrFragmentProcessor> fp(this->makeFragmentProcessor(src, matrix, srcBo unds,
397 boundaryMode)); 397 boundaryMode));
398 paint.addColorFragmentProcessor(std::move(fp)); 398 paint.addColorFragmentProcessor(std::move(fp));
399 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 399 paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
400 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect); 400 drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
401 } 401 }
402 402
403 sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU( 403 sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
404 SkSpecialImage* source, 404 SkSpecialImage* source,
405 SkSpecialImage* input, 405 SkSpecialImage* input,
406 const SkIRect& offsetBounds, 406 const SkIRect& offsetBounds,
407 const SkMatrix& matrix, 407 const SkMatrix& matrix,
408 const OutputProperties& outpu tProperties) const { 408 const OutputProperties& outpu tProperties) const {
409 SkASSERT(source->isTextureBacked()); 409 SkASSERT(source->isTextureBacked());
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 2174
2175 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2175 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2176 } 2176 }
2177 2177
2178 #endif 2178 #endif
2179 2179
2180 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2180 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2181 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2181 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2182 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2182 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2183 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2183 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698