| 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 "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
| 10 #include "GrDrawContext.h" |
| 10 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
| 11 #include "GrPath.h" | 12 #include "GrPath.h" |
| 12 #include "GrPathRange.h" | 13 #include "GrPathRange.h" |
| 13 #include "GrResourceProvider.h" | 14 #include "GrResourceProvider.h" |
| 14 #include "SkAutoKern.h" | 15 #include "SkAutoKern.h" |
| 15 #include "SkDraw.h" | 16 #include "SkDraw.h" |
| 16 #include "SkDrawProcs.h" | 17 #include "SkDrawProcs.h" |
| 17 #include "SkGlyphCache.h" | 18 #include "SkGlyphCache.h" |
| 18 #include "SkGpuDevice.h" | 19 #include "SkGpuDevice.h" |
| 19 #include "SkPath.h" | 20 #include "SkPath.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX)); | 428 GR_STATIC_ASSERT(0 == offsetof(SkPoint, fX)); |
| 428 | 429 |
| 429 return &pointArray[0].fX; | 430 return &pointArray[0].fX; |
| 430 } | 431 } |
| 431 | 432 |
| 432 void GrStencilAndCoverTextContext::flush() { | 433 void GrStencilAndCoverTextContext::flush() { |
| 433 if (fQueuedGlyphCount > 0) { | 434 if (fQueuedGlyphCount > 0) { |
| 434 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor
(), | 435 SkAutoTUnref<GrPathProcessor> pp(GrPathProcessor::Create(fPaint.getColor
(), |
| 435 fViewMatrix, | 436 fViewMatrix, |
| 436 fLocalMatrix)); | 437 fLocalMatrix)); |
| 437 fDrawTarget->drawPaths(&fPipelineBuilder, pp, fGlyphs, | 438 |
| 439 GrDrawContext* drawContext = fContext->drawContext(); |
| 440 if (!drawContext) { |
| 441 return; |
| 442 } |
| 443 |
| 444 drawContext->drawPaths(&fPipelineBuilder, pp, fGlyphs, |
| 438 fGlyphIndices, GrPathRange::kU16_PathIndexType, | 445 fGlyphIndices, GrPathRange::kU16_PathIndexType, |
| 439 get_xy_scalar_array(fGlyphPositions), | 446 get_xy_scalar_array(fGlyphPositions), |
| 440 GrPathRendering::kTranslate_PathTransformType, | 447 GrPathRendering::kTranslate_PathTransformType, |
| 441 fQueuedGlyphCount, GrPathRendering::kWinding_Fill
Type); | 448 fQueuedGlyphCount, GrPathRendering::kWinding_Fill
Type); |
| 442 | 449 |
| 443 fQueuedGlyphCount = 0; | 450 fQueuedGlyphCount = 0; |
| 444 } | 451 } |
| 445 | 452 |
| 446 if (fFallbackGlyphsIdx < kGlyphBufferSize) { | 453 if (fFallbackGlyphsIdx < kGlyphBufferSize) { |
| 447 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; | 454 int fallbackGlyphCount = kGlyphBufferSize - fFallbackGlyphsIdx; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 475 | 482 |
| 476 fGlyphs->unref(); | 483 fGlyphs->unref(); |
| 477 fGlyphs = NULL; | 484 fGlyphs = NULL; |
| 478 | 485 |
| 479 SkGlyphCache::AttachCache(fGlyphCache); | 486 SkGlyphCache::AttachCache(fGlyphCache); |
| 480 fGlyphCache = NULL; | 487 fGlyphCache = NULL; |
| 481 | 488 |
| 482 fPipelineBuilder.stencil()->setDisabled(); | 489 fPipelineBuilder.stencil()->setDisabled(); |
| 483 fStateRestore.set(NULL); | 490 fStateRestore.set(NULL); |
| 484 fViewMatrix = fContextInitialMatrix; | 491 fViewMatrix = fContextInitialMatrix; |
| 485 GrTextContext::finish(); | |
| 486 } | 492 } |
| 487 | 493 |
| OLD | NEW |