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

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

Issue 2041113004: sk_sp for gpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reserve correctly. Created 4 years, 6 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/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/GrClipMaskManager.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 17 matching lines...) Expand all
28 static bool draw_mask(GrDrawContext* drawContext, 28 static bool draw_mask(GrDrawContext* drawContext,
29 const GrClip& clip, 29 const GrClip& clip,
30 const SkMatrix& viewMatrix, 30 const SkMatrix& viewMatrix,
31 const SkIRect& maskRect, 31 const SkIRect& maskRect,
32 GrPaint* grp, 32 GrPaint* grp,
33 GrTexture* mask) { 33 GrTexture* mask) {
34 SkMatrix matrix; 34 SkMatrix matrix;
35 matrix.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect. fTop)); 35 matrix.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect. fTop));
36 matrix.postIDiv(mask->width(), mask->height()); 36 matrix.postIDiv(mask->width(), mask->height());
37 37
38 grp->addCoverageFragmentProcessor(GrSimpleTextureEffect::Create(mask, matrix , 38 grp->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(mask, matrix,
39 kDevice_GrCo ordSet))->unref(); 39 kDevice_GrCoor dSet));
40 40
41 SkMatrix inverse; 41 SkMatrix inverse;
42 if (!viewMatrix.invert(&inverse)) { 42 if (!viewMatrix.invert(&inverse)) {
43 return false; 43 return false;
44 } 44 }
45 drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(), 45 drawContext->fillRectWithLocalMatrix(clip, *grp, SkMatrix::I(),
46 SkRect::Make(maskRect), inverse); 46 SkRect::Make(maskRect), inverse);
47 return true; 47 return true;
48 } 48 }
49 49
(...skipping 242 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/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698