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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 } | 605 } |
606 | 606 |
607 // Don't compute a bounding box. For dst copy texture, we'll opt instead
for it to just copy | 607 // Don't compute a bounding box. For dst copy texture, we'll opt instead
for it to just copy |
608 // the entire dst. Realistically this is a moot point, because any conte
xt that supports | 608 // the entire dst. Realistically this is a moot point, because any conte
xt that supports |
609 // NV_path_rendering will also support NV_blend_equation_advanced. | 609 // NV_path_rendering will also support NV_blend_equation_advanced. |
610 // For clipping we'll just skip any optimizations based on the bounds. T
his does, however, | 610 // For clipping we'll just skip any optimizations based on the bounds. T
his does, however, |
611 // hurt batching. | 611 // hurt batching. |
612 SkRect bounds = SkRect::MakeIWH(pipelineBuilder->getRenderTarget()->widt
h(), | 612 SkRect bounds = SkRect::MakeIWH(pipelineBuilder->getRenderTarget()->widt
h(), |
613 pipelineBuilder->getRenderTarget()->heig
ht()); | 613 pipelineBuilder->getRenderTarget()->heig
ht()); |
614 | 614 |
615 SkAutoTUnref<GrDrawPathBatchBase> batch( | 615 SkAutoTUnref<GrDrawBatch> batch( |
616 GrDrawPathRangeBatch::Create(viewMatrix, fTextRatio, fTextInverseRat
io * x, | 616 GrDrawPathRangeBatch::Create(viewMatrix, fTextRatio, fTextInverseRat
io * x, |
617 fTextInverseRatio * y, color, | 617 fTextInverseRatio * y, color, |
618 GrPathRendering::kWinding_FillType, gly
phs, fInstanceData, | 618 GrPathRendering::kWinding_FillType, gly
phs, fInstanceData, |
619 bounds)); | 619 bounds)); |
620 | 620 |
621 dc->drawPathBatch(*pipelineBuilder, batch); | 621 dc->drawBatch(pipelineBuilder, batch); |
622 } | 622 } |
623 | 623 |
624 if (fFallbackTextBlob) { | 624 if (fFallbackTextBlob) { |
625 SkPaint fallbackSkPaint(originalSkPaint); | 625 SkPaint fallbackSkPaint(originalSkPaint); |
626 fStroke.applyToPaint(&fallbackSkPaint); | 626 fStroke.applyToPaint(&fallbackSkPaint); |
627 if (!fStroke.isFillStyle()) { | 627 if (!fStroke.isFillStyle()) { |
628 fallbackSkPaint.setStrokeWidth(fStroke.getWidth() * fTextRatio); | 628 fallbackSkPaint.setStrokeWidth(fStroke.getWidth() * fTextRatio); |
629 } | 629 } |
630 | 630 |
631 fallbackTextContext->drawTextBlob(ctx, dc, pipelineBuilder->clip(), fall
backSkPaint, | 631 fallbackTextContext->drawTextBlob(ctx, dc, pipelineBuilder->clip(), fall
backSkPaint, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 } | 705 } |
706 | 706 |
707 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { | 707 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { |
708 *count = fCount; | 708 *count = fCount; |
709 if (fCount) { | 709 if (fCount) { |
710 this->flush(); | 710 this->flush(); |
711 return fBuilder->build(); | 711 return fBuilder->build(); |
712 } | 712 } |
713 return nullptr; | 713 return nullptr; |
714 } | 714 } |
OLD | NEW |