| 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 "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 GrUserStencilSettings::StaticInit< | 613 GrUserStencilSettings::StaticInit< |
| 614 0x0000, | 614 0x0000, |
| 615 GrUserStencilTest::kNotEqual, // Stencil pass accounts for clip. | 615 GrUserStencilTest::kNotEqual, // Stencil pass accounts for clip. |
| 616 0xffff, | 616 0xffff, |
| 617 GrUserStencilOp::kZero, | 617 GrUserStencilOp::kZero, |
| 618 GrUserStencilOp::kKeep, | 618 GrUserStencilOp::kKeep, |
| 619 0xffff>() | 619 0xffff>() |
| 620 ); | 620 ); |
| 621 | 621 |
| 622 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); | 622 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); |
| 623 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) { | 623 if (fLastDrawnGlyphsID != glyphs->uniqueID()) { |
| 624 // Either this is the first draw or the glyphs object was purged sin
ce last draw. | 624 // Either this is the first draw or the glyphs object was purged sin
ce last draw. |
| 625 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c
ount()); | 625 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c
ount()); |
| 626 fLastDrawnGlyphsID = glyphs->getUniqueID(); | 626 fLastDrawnGlyphsID = glyphs->uniqueID(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 // Don't compute a bounding box. For dst copy texture, we'll opt instead
for it to just copy | 629 // Don't compute a bounding box. For dst copy texture, we'll opt instead
for it to just copy |
| 630 // the entire dst. Realistically this is a moot point, because any conte
xt that supports | 630 // the entire dst. Realistically this is a moot point, because any conte
xt that supports |
| 631 // NV_path_rendering will also support NV_blend_equation_advanced. | 631 // NV_path_rendering will also support NV_blend_equation_advanced. |
| 632 // For clipping we'll just skip any optimizations based on the bounds. T
his does, however, | 632 // For clipping we'll just skip any optimizations based on the bounds. T
his does, however, |
| 633 // hurt batching. | 633 // hurt batching. |
| 634 const SkRect bounds = SkRect::MakeIWH(drawContext->width(), drawContext-
>height()); | 634 const SkRect bounds = SkRect::MakeIWH(drawContext->width(), drawContext-
>height()); |
| 635 | 635 |
| 636 SkAutoTUnref<GrDrawBatch> batch( | 636 SkAutoTUnref<GrDrawBatch> batch( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 } | 729 } |
| 730 | 730 |
| 731 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { | 731 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { |
| 732 *count = fCount; | 732 *count = fCount; |
| 733 if (fCount) { | 733 if (fCount) { |
| 734 this->flush(); | 734 this->flush(); |
| 735 return fBuilder->build(); | 735 return fBuilder->build(); |
| 736 } | 736 } |
| 737 return nullptr; | 737 return nullptr; |
| 738 } | 738 } |
| OLD | NEW |