Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 1471883002: Make stencil and cover path rendering have more reasonable bounds. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/batches/GrDrawPathBatch.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/batches/GrDrawPathBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698