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 fDrawTarget->drawPaths(&fDrawState, fGlyphs, | 402 fDrawTarget->drawPaths(&fDrawState, fPaint.getColor(), fGlyphs, |
403 fGlyphIndices, GrPathRange::kU16_PathIndexType, | 403 fGlyphIndices, GrPathRange::kU16_PathIndexType, |
404 get_xy_scalar_array(fGlyphPositions), | 404 get_xy_scalar_array(fGlyphPositions), |
405 GrPathRendering::kTranslate_PathTransformType, | 405 GrPathRendering::kTranslate_PathTransformType, |
406 fQueuedGlyphCount, GrPathRendering::kWinding_Fill
Type); | 406 fQueuedGlyphCount, GrPathRendering::kWinding_Fill
Type); |
407 | 407 |
408 fQueuedGlyphCount = 0; | 408 fQueuedGlyphCount = 0; |
409 } | 409 } |
410 | 410 |
411 if (fFallbackGlyphsIdx < kGlyphBufferSize) { | 411 if (fFallbackGlyphsIdx < kGlyphBufferSize) { |
412 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; | 412 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 445 |
446 SkGlyphCache::AttachCache(fGlyphCache); | 446 SkGlyphCache::AttachCache(fGlyphCache); |
447 fGlyphCache = NULL; | 447 fGlyphCache = NULL; |
448 | 448 |
449 fDrawState.stencil()->setDisabled(); | 449 fDrawState.stencil()->setDisabled(); |
450 fStateRestore.set(NULL); | 450 fStateRestore.set(NULL); |
451 fContext->setMatrix(fContextInitialMatrix); | 451 fContext->setMatrix(fContextInitialMatrix); |
452 GrTextContext::finish(); | 452 GrTextContext::finish(); |
453 } | 453 } |
454 | 454 |
OLD | NEW |