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

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: 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/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrClip.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 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return nullptr; 118 return nullptr;
119 } 119 }
120 120
121 drawContext->clear(nullptr, 0x0, true); 121 drawContext->clear(nullptr, 0x0, true);
122 122
123 GrPaint tempPaint; 123 GrPaint tempPaint;
124 tempPaint.setAntiAlias(doAA); 124 tempPaint.setAntiAlias(doAA);
125 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op); 125 tempPaint.setCoverageSetOpXPFactory(SkRegion::kReplace_Op);
126 126
127 // setup new clip 127 // setup new clip
128 const SkRect clipRect = SkRect::MakeIWH(maskRect.width(), maskRect.height()) ; 128 const SkIRect clipRect = SkIRect::MakeWH(maskRect.width(), maskRect.height() );
129 GrClip clip(clipRect); 129 GrFixedClip clip(clipRect);
130 130
131 // Draw the mask into maskTexture with the path's integerized top-left at 131 // Draw the mask into maskTexture with the path's integerized top-left at
132 // the origin using tempPaint. 132 // the origin using tempPaint.
133 SkMatrix translate; 133 SkMatrix translate;
134 translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRe ct.fTop)); 134 translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRe ct.fTop));
135 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai rline)); 135 drawContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHai rline));
136 return drawContext->asTexture();; 136 return drawContext->asTexture();;
137 } 137 }
138 138
139 static void draw_path_with_mask_filter(GrContext* context, 139 static void draw_path_with_mask_filter(GrContext* context,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 if (paint.getMaskFilter()) { 294 if (paint.getMaskFilter()) {
295 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat rix, 295 draw_path_with_mask_filter(context, drawContext, clip, &grPaint, viewMat rix,
296 paint.getMaskFilter(), style, 296 paint.getMaskFilter(), style,
297 path, pathIsMutable); 297 path, pathIsMutable);
298 } else { 298 } else {
299 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style); 299 drawContext->drawPath(clip, grPaint, viewMatrix, *path, style);
300 } 300 }
301 } 301 }
OLDNEW
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698