| 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 "GrDrawContext.h" |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 509 } |
| 510 | 510 |
| 511 SkMatrix drawMatrix(viewMatrix); | 511 SkMatrix drawMatrix(viewMatrix); |
| 512 drawMatrix.preTranslate(x, y); | 512 drawMatrix.preTranslate(x, y); |
| 513 drawMatrix.preScale(fTextRatio, fTextRatio); | 513 drawMatrix.preScale(fTextRatio, fTextRatio); |
| 514 | 514 |
| 515 SkMatrix& localMatrix = fLocalMatrixTemplate; | 515 SkMatrix& localMatrix = fLocalMatrixTemplate; |
| 516 localMatrix.setTranslateX(x); | 516 localMatrix.setTranslateX(x); |
| 517 localMatrix.setTranslateY(y); | 517 localMatrix.setTranslateY(y); |
| 518 | 518 |
| 519 // Don't compute a bounding box. For dst copy texture, we'll opt instead
for it to just copy |
| 520 // the entire dst. Realistically this is a moot point, because any conte
xt that supports |
| 521 // NV_path_rendering will also support NV_blend_equation_advanced. |
| 522 // For clipping we'll just skip any optimizations based on the bounds. T
his does, however, |
| 523 // hurt batching. |
| 524 SkRect bounds = SkRect::MakeIWH(pipelineBuilder->getRenderTarget()->widt
h(), |
| 525 pipelineBuilder->getRenderTarget()->heig
ht()); |
| 526 |
| 519 dc->drawPathsFromRange(pipelineBuilder, drawMatrix, localMatrix, color,
glyphs, fDraw, | 527 dc->drawPathsFromRange(pipelineBuilder, drawMatrix, localMatrix, color,
glyphs, fDraw, |
| 520 GrPathRendering::kWinding_FillType); | 528 GrPathRendering::kWinding_FillType, bounds); |
| 521 } | 529 } |
| 522 | 530 |
| 523 if (fFallbackTextBlob) { | 531 if (fFallbackTextBlob) { |
| 524 SkPaint fallbackSkPaint(originalSkPaint); | 532 SkPaint fallbackSkPaint(originalSkPaint); |
| 525 fStroke.applyToPaint(&fallbackSkPaint); | 533 fStroke.applyToPaint(&fallbackSkPaint); |
| 526 if (!fStroke.isFillStyle()) { | 534 if (!fStroke.isFillStyle()) { |
| 527 fallbackSkPaint.setStrokeWidth(fStroke.getWidth() * fTextRatio); | 535 fallbackSkPaint.setStrokeWidth(fStroke.getWidth() * fTextRatio); |
| 528 } | 536 } |
| 529 | 537 |
| 530 fallbackTextContext->drawTextBlob(dc, pipelineBuilder->getRenderTarget()
, | 538 fallbackTextContext->drawTextBlob(dc, pipelineBuilder->getRenderTarget()
, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 fBuffIdx = 0; | 609 fBuffIdx = 0; |
| 602 } | 610 } |
| 603 | 611 |
| 604 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfInit
ialized() { | 612 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfInit
ialized() { |
| 605 if (!this->isInitialized()) { | 613 if (!this->isInitialized()) { |
| 606 return nullptr; | 614 return nullptr; |
| 607 } | 615 } |
| 608 this->flush(); | 616 this->flush(); |
| 609 return fBuilder->build(); | 617 return fBuilder->build(); |
| 610 } | 618 } |
| OLD | NEW |