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

Side by Side Diff: src/gpu/GrBlurUtils.cpp

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: remove iswideopen 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
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 "GrBlurUtils.h" 8 #include "GrBlurUtils.h"
9 #include "GrDrawContext.h" 9 #include "GrDrawContext.h"
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 return nullptr; 124 return nullptr;
125 } 125 }
126 126
127 drawContext->clear(nullptr, 0x0, true); 127 drawContext->clear(nullptr, 0x0, true);
128 128
129 GrPaint tempPaint; 129 GrPaint tempPaint;
130 tempPaint.setAntiAlias(doAA); 130 tempPaint.setAntiAlias(doAA);
131 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); 131 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
132 132
133 // setup new clip 133 // setup new clip
134 const SkRect clipRect = SkRect::MakeWH(maskRect->width(), maskRect->height() ); 134 GrFixedClip clip;
135 GrClip clip(clipRect); 135 clip.resetNonAA(SkRect::MakeWH(maskRect->width(), maskRect->height()));
136 136
137 // Draw the mask into maskTexture with the path's integerized top-left at 137 // Draw the mask into maskTexture with the path's integerized top-left at
138 // the origin using tempPaint. 138 // the origin using tempPaint.
139 SkMatrix translate; 139 SkMatrix translate;
140 translate.setTranslate(-maskRect->fLeft, -maskRect->fTop); 140 translate.setTranslate(-maskRect->fLeft, -maskRect->fTop);
141 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai rline)); 141 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai rline));
142 return drawContext->asTexture();; 142 return drawContext->asTexture();;
143 } 143 }
144 144
145 static void draw_path_with_mask_filter(GrContext* context, 145 static void draw_path_with_mask_filter(GrContext* context,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 295 }
296 296
297 if (paint.getMaskFilter()) { 297 if (paint.getMaskFilter()) {
298 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat rix, 298 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat rix,
299 paint.getMaskFilter(), style, 299 paint.getMaskFilter(), style,
300 path, pathIsMutable); 300 path, pathIsMutable);
301 } else { 301 } else {
302 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); 302 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style);
303 } 303 }
304 } 304 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698