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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 ++fPendingGlyphCount; | 407 ++fPendingGlyphCount; |
408 } | 408 } |
409 | 409 |
410 void GrStencilAndCoverTextContext::flush() { | 410 void GrStencilAndCoverTextContext::flush() { |
411 if (0 == fPendingGlyphCount) { | 411 if (0 == fPendingGlyphCount) { |
412 return; | 412 return; |
413 } | 413 } |
414 | 414 |
415 fDrawTarget->drawPaths(fGlyphs, fIndexBuffer, fPendingGlyphCount, | 415 fDrawTarget->drawPaths(fGlyphs, fIndexBuffer, fPendingGlyphCount, |
416 fTransformBuffer, fTransformType, SkPath::kWinding_Fi
llType); | 416 fTransformBuffer, fTransformType, GrPathRendering::kW
inding_FillType); |
417 | 417 |
418 fPendingGlyphCount = 0; | 418 fPendingGlyphCount = 0; |
419 } | 419 } |
420 | 420 |
421 void GrStencilAndCoverTextContext::finish() { | 421 void GrStencilAndCoverTextContext::finish() { |
422 this->flush(); | 422 this->flush(); |
423 | 423 |
424 fGlyphs->unref(); | 424 fGlyphs->unref(); |
425 fGlyphs = NULL; | 425 fGlyphs = NULL; |
426 | 426 |
427 SkGlyphCache::AttachCache(fGlyphCache); | 427 SkGlyphCache::AttachCache(fGlyphCache); |
428 fGlyphCache = NULL; | 428 fGlyphCache = NULL; |
429 | 429 |
430 fDrawTarget->drawState()->stencil()->setDisabled(); | 430 fDrawTarget->drawState()->stencil()->setDisabled(); |
431 fStateRestore.set(NULL); | 431 fStateRestore.set(NULL); |
432 fContext->setMatrix(fContextInitialMatrix); | 432 fContext->setMatrix(fContextInitialMatrix); |
433 GrTextContext::finish(); | 433 GrTextContext::finish(); |
434 } | 434 } |
435 | 435 |
OLD | NEW |