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

Side by Side Diff: src/effects/SkColorFilterImageFilter.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/SkArithmeticModePriv.h ('k') | src/effects/SkDisplacementMapEffect.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 "SkColorFilterImageFilter.h" 8 #include "SkColorFilterImageFilter.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou nds.size())); 82 sk_sp<SkSpecialSurface> surf(source->makeSurface(ctx.outputProperties(), bou nds.size()));
83 if (!surf) { 83 if (!surf) {
84 return nullptr; 84 return nullptr;
85 } 85 }
86 86
87 SkCanvas* canvas = surf->getCanvas(); 87 SkCanvas* canvas = surf->getCanvas();
88 SkASSERT(canvas); 88 SkASSERT(canvas);
89 89
90 SkPaint paint; 90 SkPaint paint;
91 91
92 paint.setXfermodeMode(SkXfermode::kSrc_Mode); 92 paint.setBlendMode(SkBlendMode::kSrc);
93 paint.setColorFilter(fColorFilter); 93 paint.setColorFilter(fColorFilter);
94 94
95 // TODO: it may not be necessary to clear or drawPaint inside the input boun ds 95 // TODO: it may not be necessary to clear or drawPaint inside the input boun ds
96 // (see skbug.com/5075) 96 // (see skbug.com/5075)
97 if (fColorFilter->affectsTransparentBlack()) { 97 if (fColorFilter->affectsTransparentBlack()) {
98 // The subsequent input->draw() call may not fill the entire canvas. For filters which 98 // The subsequent input->draw() call may not fill the entire canvas. For filters which
99 // affect transparent black, ensure that the filter is applied everywher e. 99 // affect transparent black, ensure that the filter is applied everywher e.
100 paint.setColor(SK_ColorTRANSPARENT); 100 paint.setColor(SK_ColorTRANSPARENT);
101 canvas->drawPaint(paint); 101 canvas->drawPaint(paint);
102 paint.setColor(SK_ColorBLACK); 102 paint.setColor(SK_ColorBLACK);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (this->getInput(0)) { 140 if (this->getInput(0)) {
141 this->getInput(0)->toString(str); 141 this->getInput(0)->toString(str);
142 } 142 }
143 143
144 str->appendf(") color filter: "); 144 str->appendf(") color filter: ");
145 fColorFilter->toString(str); 145 fColorFilter->toString(str);
146 146
147 str->append(")"); 147 str->append(")");
148 } 148 }
149 #endif 149 #endif
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticModePriv.h ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698