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

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

Issue 50673005: Revert "Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage … (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkDraw.cpp ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 "GrSWMaskHelper.h" 8 #include "GrSWMaskHelper.h"
9 #include "GrDrawState.h" 9 #include "GrDrawState.h"
10 #include "GrDrawTargetCaps.h" 10 #include "GrDrawTargetCaps.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } else { 66 } else {
67 if (stroke.isFillStyle()) { 67 if (stroke.isFillStyle()) {
68 paint.setStyle(SkPaint::kFill_Style); 68 paint.setStyle(SkPaint::kFill_Style);
69 } else { 69 } else {
70 paint.setStyle(SkPaint::kStroke_Style); 70 paint.setStyle(SkPaint::kStroke_Style);
71 paint.setStrokeJoin(stroke.getJoin()); 71 paint.setStrokeJoin(stroke.getJoin());
72 paint.setStrokeCap(stroke.getCap()); 72 paint.setStrokeCap(stroke.getCap());
73 paint.setStrokeWidth(stroke.getWidth()); 73 paint.setStrokeWidth(stroke.getWidth());
74 } 74 }
75 } 75 }
76 paint.setAntiAlias(antiAlias);
76 77
77 SkXfermode* mode = SkXfermode::Create(op_to_mode(op)); 78 if (SkRegion::kReplace_Op == op && 0xFF == alpha) {
78 79 SkASSERT(0xFF == paint.getAlpha());
79 paint.setXfermode(mode); 80 fDraw.drawPathCoverage(path, paint);
80 paint.setAntiAlias(antiAlias); 81 } else {
81 paint.setColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); 82 paint.setXfermodeMode(op_to_mode(op));
82 83 paint.setColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
83 fDraw.drawPath(path, paint); 84 fDraw.drawPath(path, paint);
84 85 }
85 SkSafeUnref(mode);
86 } 86 }
87 87
88 bool GrSWMaskHelper::init(const SkIRect& resultBounds, 88 bool GrSWMaskHelper::init(const SkIRect& resultBounds,
89 const SkMatrix* matrix) { 89 const SkMatrix* matrix) {
90 if (NULL != matrix) { 90 if (NULL != matrix) {
91 fMatrix = *matrix; 91 fMatrix = *matrix;
92 } else { 92 } else {
93 fMatrix.setIdentity(); 93 fMatrix.setIdentity();
94 } 94 }
95 95
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 maskMatrix.preConcat(drawState->getViewMatrix()); 204 maskMatrix.preConcat(drawState->getViewMatrix());
205 205
206 drawState->addCoverageEffect( 206 drawState->addCoverageEffect(
207 GrSimpleTextureEffect::Create(texture, 207 GrSimpleTextureEffect::Create(texture,
208 maskMatrix, 208 maskMatrix,
209 GrTextureParams::kNone_Fi lterMode, 209 GrTextureParams::kNone_Fi lterMode,
210 kPosition_GrCoordSet))->u nref(); 210 kPosition_GrCoordSet))->u nref();
211 211
212 target->drawSimpleRect(dstRect); 212 target->drawSimpleRect(dstRect);
213 } 213 }
OLDNEW
« no previous file with comments | « src/core/SkDraw.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698