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

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

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: rebase Created 6 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/GrRODrawState.cpp ('k') | src/gpu/SkGpuDevice.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 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 "GrDrawState.h" 10 #include "GrDrawState.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 // We want to use device coords to compute the texture coordinates. We set o ur matrix to be 355 // We want to use device coords to compute the texture coordinates. We set o ur matrix to be
356 // equal to the view matrix followed by a translation so that the top-left o f the device bounds 356 // equal to the view matrix followed by a translation so that the top-left o f the device bounds
357 // maps to 0,0, and then a scaling matrix to normalized coords. We apply thi s matrix to the 357 // maps to 0,0, and then a scaling matrix to normalized coords. We apply thi s matrix to the
358 // vertex positions rather than local coords. 358 // vertex positions rather than local coords.
359 SkMatrix maskMatrix; 359 SkMatrix maskMatrix;
360 maskMatrix.setIDiv(texture->width(), texture->height()); 360 maskMatrix.setIDiv(texture->width(), texture->height());
361 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop )); 361 maskMatrix.preTranslate(SkIntToScalar(-rect.fLeft), SkIntToScalar(-rect.fTop ));
362 maskMatrix.preConcat(drawState->getViewMatrix()); 362 maskMatrix.preConcat(drawState->getViewMatrix());
363 363
364 drawState->addCoverageEffect( 364 drawState->addCoverageProcessor(
365 GrSimpleTextureEffect::Create(texture, 365 GrSimpleTextureEffect::Create(texture,
366 maskMatrix, 366 maskMatrix,
367 GrTextureParams::kNone_Fi lterMode, 367 GrTextureParams::kNone_Fi lterMode,
368 kPosition_GrCoordSet))->u nref(); 368 kPosition_GrCoordSet))->u nref();
369 369
370 target->drawSimpleRect(dstRect); 370 target->drawSimpleRect(dstRect);
371 } 371 }
OLDNEW
« no previous file with comments | « src/gpu/GrRODrawState.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698