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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1485973004: Reduce use of GrRenderTarget in GrTextContexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebased to ToT 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 17cdbf3b6be825264ee2e523c0b58aa0c435f5dd..c07b0602ea6b1c0c17eb1d85645f41d2bd3fa562 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -248,15 +248,13 @@ void GrDrawContext::drawRect(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
- GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
-
SkScalar width = nullptr == strokeInfo ? -1 : strokeInfo->getWidth();
// Check if this is a full RT draw and can be replaced with a clear. We don't bother checking
// cases where the RT is fully inside a stroke.
if (width < 0) {
SkRect rtRect;
- pipelineBuilder.getRenderTarget()->getBoundsRect(&rtRect);
+ fRenderTarget->getBoundsRect(&rtRect);
SkRect clipSpaceRTRect = rtRect;
bool checkClip = GrClip::kWideOpen_ClipType != clip.clipType();
if (checkClip) {
@@ -287,7 +285,7 @@ void GrDrawContext::drawRect(const GrClip& clip,
}
GrColor color = paint.getColor();
- bool needAA = should_apply_coverage_aa(paint, pipelineBuilder.getRenderTarget());
+ bool needAA = should_apply_coverage_aa(paint, fRenderTarget);
// The fill path can handle rotation but not skew
// The stroke path needs the rect to remain axis aligned (no rotation or skew)
@@ -295,6 +293,8 @@ void GrDrawContext::drawRect(const GrClip& clip,
bool canApplyAA = width >=0 ? viewMatrix.rectStaysRect() :
view_matrix_ok_for_aa_fill_rect(viewMatrix);
+ GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
+
if (needAA && canApplyAA) {
SkASSERT(!viewMatrix.hasPerspective());
SkAutoTUnref<GrDrawBatch> batch;
@@ -365,7 +365,8 @@ void GrDrawContext::fillRectWithLocalMatrix(const GrClip& clip,
AutoCheckFlush acf(fDrawingManager);
GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
- if (should_apply_coverage_aa(paint, pipelineBuilder.getRenderTarget()) &&
+
+ if (should_apply_coverage_aa(paint, fRenderTarget) &&
view_matrix_ok_for_aa_fill_rect(viewMatrix)) {
SkAutoTUnref<GrDrawBatch> batch(GrAAFillRectBatch::Create(
paint.getColor(), viewMatrix, localMatrix, rectToDraw));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698