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/core/SkImageFilter.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/core/SkGpuBlurUtils.cpp ('k') | src/core/SkMatrixImageFilter.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 "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return true; 274 return true;
275 } 275 }
276 276
277 #if SK_SUPPORT_GPU 277 #if SK_SUPPORT_GPU
278 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context, 278 sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
279 sk_sp<GrFragmentProcessor> fp, 279 sk_sp<GrFragmentProcessor> fp,
280 const SkIRect& bounds, 280 const SkIRect& bounds,
281 const OutputProperties& outputPr operties) { 281 const OutputProperties& outputPr operties) {
282 GrPaint paint; 282 GrPaint paint;
283 paint.addColorFragmentProcessor(std::move(fp)); 283 paint.addColorFragmentProcessor(std::move(fp));
284 paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 284 paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
285 285
286 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace()); 286 sk_sp<SkColorSpace> colorSpace = sk_ref_sp(outputProperties.colorSpace());
287 GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get()); 287 GrPixelConfig config = GrRenderableConfigForColorSpace(colorSpace.get());
288 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp rox, 288 sk_sp<GrDrawContext> drawContext(context->makeDrawContext(SkBackingFit::kApp rox,
289 bounds.width(), bo unds.height(), 289 bounds.width(), bo unds.height(),
290 config, 290 config,
291 std::move(colorSpa ce))); 291 std::move(colorSpa ce)));
292 if (!drawContext) { 292 if (!drawContext) {
293 return nullptr; 293 return nullptr;
294 } 294 }
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset)); 462 sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset));
463 463
464 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked()); 464 SkASSERT(!result || src->isTextureBacked() == result->isTextureBacked());
465 465
466 return result; 466 return result;
467 } 467 }
468 468
469 void SkImageFilter::PurgeCache() { 469 void SkImageFilter::PurgeCache() {
470 SkImageFilterCache::Get()->purge(); 470 SkImageFilterCache::Get()->purge();
471 } 471 }
OLDNEW
« no previous file with comments | « src/core/SkGpuBlurUtils.cpp ('k') | src/core/SkMatrixImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698