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

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

Issue 794843002: Revert of Remove GP from drawstate, revision of invariant output for GP (Closed) Base URL: https://skia.googlesource.com/skia.git@color-to-gp
Patch Set: Created 6 years 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/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.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 2014 Google Inc. 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" 8 #include "GrStencilAndCoverTextContext.h"
9 #include "GrBitmapTextContext.h" 9 #include "GrBitmapTextContext.h"
10 #include "GrDrawTarget.h" 10 #include "GrDrawTarget.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 static const SkScalar* get_xy_scalar_array(const SkPoint* pointArray) { 393 static const SkScalar* get_xy_scalar_array(const SkPoint* pointArray) {
394 GR_STATIC_ASSERT(2 * sizeof(SkScalar) == sizeof(SkPoint)); 394 GR_STATIC_ASSERT(2 * sizeof(SkScalar) == sizeof(SkPoint));
395 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX)); 395 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX));
396 396
397 return &pointArray[0].fX; 397 return &pointArray[0].fX;
398 } 398 }
399 399
400 void GrStencilAndCoverTextContext::flush() { 400 void GrStencilAndCoverTextContext::flush() {
401 if (fQueuedGlyphCount > 0) { 401 if (fQueuedGlyphCount > 0) {
402 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor ())); 402 fDrawTarget->drawPaths(&fDrawState, fPaint.getColor(), fGlyphs,
403 fDrawTarget->drawPaths(&fDrawState, pp, fGlyphs,
404 fGlyphIndices, GrPathRange::kU16_PathIndexType, 403 fGlyphIndices, GrPathRange::kU16_PathIndexType,
405 get_xy_scalar_array(fGlyphPositions), 404 get_xy_scalar_array(fGlyphPositions),
406 GrPathRendering::kTranslate_PathTransformType, 405 GrPathRendering::kTranslate_PathTransformType,
407 fQueuedGlyphCount, GrPathRendering::kWinding_Fill Type); 406 fQueuedGlyphCount, GrPathRendering::kWinding_Fill Type);
408 407
409 fQueuedGlyphCount = 0; 408 fQueuedGlyphCount = 0;
410 } 409 }
411 410
412 if (fFallbackGlyphsIdx < kGlyphBufferSize) { 411 if (fFallbackGlyphsIdx < kGlyphBufferSize) {
413 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; 412 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 445
447 SkGlyphCache::AttachCache(fGlyphCache); 446 SkGlyphCache::AttachCache(fGlyphCache);
448 fGlyphCache = NULL; 447 fGlyphCache = NULL;
449 448
450 fDrawState.stencil()->setDisabled(); 449 fDrawState.stencil()->setDisabled();
451 fStateRestore.set(NULL); 450 fStateRestore.set(NULL);
452 fContext->setMatrix(fContextInitialMatrix); 451 fContext->setMatrix(fContextInitialMatrix);
453 GrTextContext::finish(); 452 GrTextContext::finish();
454 } 453 }
455 454
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698