| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |