| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 fTransformBuffer[2 * fPendingGlyphCount + 1] = -fTextInverseRatio * y; | 360 fTransformBuffer[2 * fPendingGlyphCount + 1] = -fTextInverseRatio * y; |
| 361 | 361 |
| 362 ++fPendingGlyphCount; | 362 ++fPendingGlyphCount; |
| 363 } | 363 } |
| 364 | 364 |
| 365 void GrStencilAndCoverTextContext::flush() { | 365 void GrStencilAndCoverTextContext::flush() { |
| 366 if (0 == fPendingGlyphCount) { | 366 if (0 == fPendingGlyphCount) { |
| 367 return; | 367 return; |
| 368 } | 368 } |
| 369 | 369 |
| 370 fDrawTarget->drawPaths(&fDrawState, fGlyphs, fIndexBuffer, fPendingGlyphCoun
t, fTransformBuffer, | 370 fDrawTarget->drawPaths(&fDrawState, fGlyphs, fIndexBuffer, GrPathRange::kU16
_PathIndexType, |
| 371 GrPathRendering::kTranslate_PathTransformType, | 371 fTransformBuffer, GrPathRendering::kTranslate_PathTra
nsformType, |
| 372 GrPathRendering::kWinding_FillType); | 372 fPendingGlyphCount, GrPathRendering::kWinding_FillTyp
e); |
| 373 | 373 |
| 374 fPendingGlyphCount = 0; | 374 fPendingGlyphCount = 0; |
| 375 } | 375 } |
| 376 | 376 |
| 377 void GrStencilAndCoverTextContext::finish() { | 377 void GrStencilAndCoverTextContext::finish() { |
| 378 this->flush(); | 378 this->flush(); |
| 379 | 379 |
| 380 fGlyphs->unref(); | 380 fGlyphs->unref(); |
| 381 fGlyphs = NULL; | 381 fGlyphs = NULL; |
| 382 | 382 |
| 383 SkGlyphCache::AttachCache(fGlyphCache); | 383 SkGlyphCache::AttachCache(fGlyphCache); |
| 384 fGlyphCache = NULL; | 384 fGlyphCache = NULL; |
| 385 | 385 |
| 386 fDrawState.stencil()->setDisabled(); | 386 fDrawState.stencil()->setDisabled(); |
| 387 fStateRestore.set(NULL); | 387 fStateRestore.set(NULL); |
| 388 fContext->setMatrix(fContextInitialMatrix); | 388 fContext->setMatrix(fContextInitialMatrix); |
| 389 GrTextContext::finish(); | 389 GrTextContext::finish(); |
| 390 } | 390 } |
| 391 | 391 |
| OLD | NEW |