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

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

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash Created 4 years, 7 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/SkImageFilter.cpp ('k') | src/effects/SkBlurMaskFilter.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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 config)); 107 config));
108 if (!drawContext) { 108 if (!drawContext) {
109 return nullptr; 109 return nullptr;
110 } 110 }
111 111
112 GrPaint grPaint; 112 GrPaint grPaint;
113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode); 113 grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
114 SkRegion::Iterator iter(fRegion); 114 SkRegion::Iterator iter(fRegion);
115 drawContext->clear(nullptr, 0x0, true); 115 drawContext->clear(nullptr, 0x0, true);
116 116
117 GrClip clip(SkRect::Make(SkIRect::MakeWH(bounds.width(), bounds.height()))); 117 GrFixedClip clip(SkIRect::MakeWH(bounds.width(), bounds.height()));
118 while (!iter.done()) { 118 while (!iter.done()) {
119 SkRect rect = SkRect::Make(iter.rect()); 119 SkRect rect = SkRect::Make(iter.rect());
120 drawContext->drawRect(clip, grPaint, inMatrix, rect); 120 drawContext->drawRect(clip, grPaint, inMatrix, rect);
121 iter.next(); 121 iter.next();
122 } 122 }
123 123
124 return drawContext->asTexture(); 124 return drawContext->asTexture();
125 } 125 }
126 #endif 126 #endif
127 127
(...skipping 131 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/SkImageFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698