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

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

Issue 1348583002: Make skpaint->grpaint flow work for composing draws (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused inheriteds to satisfy clang Created 5 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/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrFragmentProcessor.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"
11 #include "GrContext.h" 11 #include "GrContext.h"
12 #include "effects/GrSimpleTextureEffect.h" 12 #include "effects/GrSimpleTextureEffect.h"
13 #include "GrStrokeInfo.h" 13 #include "GrStrokeInfo.h"
14 #include "GrTexture.h" 14 #include "GrTexture.h"
15 #include "GrTextureProvider.h" 15 #include "GrTextureProvider.h"
16 #include "SkDraw.h" 16 #include "SkDraw.h"
17 #include "SkGr.h" 17 #include "SkGrPriv.h"
18 #include "SkMaskFilter.h" 18 #include "SkMaskFilter.h"
19 #include "SkPaint.h" 19 #include "SkPaint.h"
20 20
21 static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r ect) { 21 static bool clip_bounds_quick_reject(const SkIRect& clipBounds, const SkIRect& r ect) {
22 return clipBounds.isEmpty() || rect.isEmpty() || !SkIRect::Intersects(clipBo unds, rect); 22 return clipBounds.isEmpty() || rect.isEmpty() || !SkIRect::Intersects(clipBo unds, rect);
23 } 23 }
24 24
25 // Draw a mask using the supplied paint. Since the coverage/geometry 25 // Draw a mask using the supplied paint. Since the coverage/geometry
26 // is already burnt into the mask this boils down to a rect draw. 26 // is already burnt into the mask this boils down to a rect draw.
27 // Return true if the mask was successfully drawn. 27 // Return true if the mask was successfully drawn.
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 // should I push prePathMatrix on our MV stack temporarily, instead 190 // should I push prePathMatrix on our MV stack temporarily, instead
191 // of applying it here? See SkDraw.cpp 191 // of applying it here? See SkDraw.cpp
192 pathPtr->transform(*prePathMatrix, result); 192 pathPtr->transform(*prePathMatrix, result);
193 pathPtr = result; 193 pathPtr = result;
194 } 194 }
195 } 195 }
196 // at this point we're done with prePathMatrix 196 // at this point we're done with prePathMatrix
197 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;) 197 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;)
198 198
199 GrPaint grPaint; 199 GrPaint grPaint;
200 if (!SkPaint2GrPaint(context, paint, viewMatrix, true, &grPaint)) { 200 if (!SkPaintToGrPaint(context, paint, viewMatrix, &grPaint)) {
201 return; 201 return;
202 } 202 }
203 203
204 const SkRect* cullRect = nullptr; // TODO: what is our bounds? 204 const SkRect* cullRect = nullptr; // TODO: what is our bounds?
205 if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPat h.init(), *pathPtr, 205 if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPat h.init(), *pathPtr,
206 &strokeIn fo, cullRect)) { 206 &strokeIn fo, cullRect)) {
207 pathPtr = effectPath.get(); 207 pathPtr = effectPath.get();
208 pathIsMutable = true; 208 pathIsMutable = true;
209 } 209 }
210 210
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 SkPaint::kFill_Sty le; 292 SkPaint::kFill_Sty le;
293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar get, 293 draw_with_mask_filter(drawContext, context->textureProvider(), renderTar get,
294 clip, viewMatrix, *devPathPtr, 294 clip, viewMatrix, *devPathPtr,
295 paint.getMaskFilter(), clipBounds, &grPaint, style ); 295 paint.getMaskFilter(), clipBounds, &grPaint, style );
296 return; 296 return;
297 } 297 }
298 298
299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str okeInfo); 299 drawContext->drawPath(renderTarget, clip, grPaint, viewMatrix, *pathPtr, str okeInfo);
300 } 300 }
301 301
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698