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

Side by Side Diff: src/gpu/GrSWMaskHelper.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/gpu/GrProcessorUnitTest.cpp ('k') | src/gpu/GrTextureParamsAdjuster.h » ('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 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 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // a translation so that the top-left of the device bounds maps to 0,0, and then a scaling 182 // a translation so that the top-left of the device bounds maps to 0,0, and then a scaling
183 // matrix to normalized coords. 183 // matrix to normalized coords.
184 SkMatrix maskMatrix; 184 SkMatrix maskMatrix;
185 maskMatrix.setIDiv(texture->width(), texture->height()); 185 maskMatrix.setIDiv(texture->width(), texture->height());
186 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop )); 186 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop ));
187 187
188 GrPipelineBuilder pipelineBuilder(*paint, drawContext->mustUseHWAA(*paint)); 188 GrPipelineBuilder pipelineBuilder(*paint, drawContext->mustUseHWAA(*paint));
189 pipelineBuilder.setUserStencil(userStencilSettings); 189 pipelineBuilder.setUserStencil(userStencilSettings);
190 190
191 pipelineBuilder.addCoverageFragmentProcessor( 191 pipelineBuilder.addCoverageFragmentProcessor(
192 GrSimpleTextureEffect::Create(texture, 192 GrSimpleTextureEffect::Make(texture,
193 maskMatrix, 193 maskMatrix,
194 GrTextureParams::kNone_Fi lterMode, 194 GrTextureParams::kNone_Filt erMode,
195 kDevice_GrCoordSet))->unr ef(); 195 kDevice_GrCoordSet));
196 196
197 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S kMatrix::I(), 197 SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, S kMatrix::I(),
198 dstRect, nullptr, &invert)); 198 dstRect, nullptr, &invert));
199 drawContext->drawBatch(pipelineBuilder, clip, batch); 199 drawContext->drawBatch(pipelineBuilder, clip, batch);
200 } 200 }
OLDNEW
« no previous file with comments | « src/gpu/GrProcessorUnitTest.cpp ('k') | src/gpu/GrTextureParamsAdjuster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698