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

Side by Side Diff: src/effects/SkAlphaThresholdFilter.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/SkXfermodeInterpretation.cpp ('k') | src/effects/SkArithmeticMode.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 sk_sp<GrDrawContext> drawContext(context->makeDrawContextWithFallback(SkBack ingFit::kApprox, 100 sk_sp<GrDrawContext> drawContext(context->makeDrawContextWithFallback(SkBack ingFit::kApprox,
101 bounds .width(), 101 bounds .width(),
102 bounds .height(), 102 bounds .height(),
103 kAlpha _8_GrPixelConfig, 103 kAlpha _8_GrPixelConfig,
104 nullpt r)); 104 nullpt r));
105 if (!drawContext) { 105 if (!drawContext) {
106 return nullptr; 106 return nullptr;
107 } 107 }
108 108
109 GrPaint grPaint; 109 GrPaint grPaint;
110 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 110 grPaint.setPorterDuffXPFactory(SkBlendMode::kSrc);
111 SkRegion::Iterator iter(fRegion); 111 SkRegion::Iterator iter(fRegion);
112 drawContext->clear(nullptr, 0x0, true); 112 drawContext->clear(nullptr, 0x0, true);
113 113
114 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height())); 114 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height()));
115 while (!iter.done()) { 115 while (!iter.done()) {
116 SkRect rect = SkRect::Make(iter.rect()); 116 SkRect rect = SkRect::Make(iter.rect());
117 drawContext->drawRect(clip, grPaint, inMatrix, rect); 117 drawContext->drawRect(clip, grPaint, inMatrix, rect);
118 iter.next(); 118 iter.next();
119 } 119 }
120 120
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 dst); 259 dst);
260 } 260 }
261 261
262 #ifndef SK_IGNORE_TO_STRING 262 #ifndef SK_IGNORE_TO_STRING
263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const { 263 void SkAlphaThresholdFilterImpl::toString(SkString* str) const {
264 str->appendf("SkAlphaThresholdImageFilter: ("); 264 str->appendf("SkAlphaThresholdImageFilter: (");
265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold); 265 str->appendf("inner: %f outer: %f", fInnerThreshold, fOuterThreshold);
266 str->append(")"); 266 str->append(")");
267 } 267 }
268 #endif 268 #endif
OLDNEW
« no previous file with comments | « src/core/SkXfermodeInterpretation.cpp ('k') | src/effects/SkArithmeticMode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698