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

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

Issue 1480353002: APIs which took colorPOI / coveragePOI pairs updated to take a GrPipelineOptimizations struct (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.h ('k') | src/gpu/GrPipeline.cpp » ('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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrDrawTarget.h" 9 #include "GrDrawTarget.h"
10 10
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 SkDebugf("%d: %s\n", i, fBatches[i]->name()); 106 SkDebugf("%d: %s\n", i, fBatches[i]->name());
107 #if 0 107 #if 0
108 SkString str = fBatches[i]->dumpInfo(); 108 SkString str = fBatches[i]->dumpInfo();
109 SkDebugf("%s\n", str.c_str()); 109 SkDebugf("%s\n", str.c_str());
110 #endif 110 #endif
111 } 111 }
112 } 112 }
113 #endif 113 #endif
114 114
115 bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuil der, 115 bool GrDrawTarget::setupDstReadIfNecessary(const GrPipelineBuilder& pipelineBuil der,
116 const GrProcOptInfo& colorPOI, 116 const GrPipelineOptimizations& optimi zations,
117 const GrProcOptInfo& coveragePOI,
118 GrXferProcessor::DstTexture* dstTextu re, 117 GrXferProcessor::DstTexture* dstTextu re,
119 const SkRect& batchBounds) { 118 const SkRect& batchBounds) {
120 SkRect bounds = batchBounds; 119 SkRect bounds = batchBounds;
121 bounds.outset(0.5f, 0.5f); 120 bounds.outset(0.5f, 0.5f);
122 121
123 if (!pipelineBuilder.willXPNeedDstTexture(*this->caps(), colorPOI, coverageP OI)) { 122 if (!pipelineBuilder.willXPNeedDstTexture(*this->caps(), optimizations)) {
124 return true; 123 return true;
125 } 124 }
126 125
127 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); 126 GrRenderTarget* rt = pipelineBuilder.getRenderTarget();
128 127
129 if (this->caps()->textureBarrierSupport()) { 128 if (this->caps()->textureBarrierSupport()) {
130 if (GrTexture* rtTex = rt->asTexture()) { 129 if (GrTexture* rtTex = rt->asTexture()) {
131 // The render target is a texture, so we can read from it directly i n the shader. The XP 130 // The render target is a texture, so we can read from it directly i n the shader. The XP
132 // will be responsible to detect this situation and request a textur e barrier. 131 // will be responsible to detect this situation and request a textur e barrier.
133 dstTexture->setTexture(rtTex); 132 dstTexture->setTexture(rtTex);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 GrPipeline::CreateArgs args; 537 GrPipeline::CreateArgs args;
539 args.fPipelineBuilder = pipelineBuilder; 538 args.fPipelineBuilder = pipelineBuilder;
540 args.fCaps = this->caps(); 539 args.fCaps = this->caps();
541 args.fScissor = scissor; 540 args.fScissor = scissor;
542 batch->getPipelineOptimizations(&args.fOpts); 541 batch->getPipelineOptimizations(&args.fOpts);
543 args.fOpts.fColorPOI.completeCalculations(pipelineBuilder->fColorFragmentPro cessors.begin(), 542 args.fOpts.fColorPOI.completeCalculations(pipelineBuilder->fColorFragmentPro cessors.begin(),
544 pipelineBuilder->numColorFragmentP rocessors()); 543 pipelineBuilder->numColorFragmentP rocessors());
545 args.fOpts.fCoveragePOI.completeCalculations( 544 args.fOpts.fCoveragePOI.completeCalculations(
546 pipelineBuilder->fCoverageFragmen tProcessors.begin(), 545 pipelineBuilder->fCoverageFragmen tProcessors.begin(),
547 pipelineBuilder->numCoverageFragm entProcessors()); 546 pipelineBuilder->numCoverageFragm entProcessors());
548 if (!this->setupDstReadIfNecessary(*pipelineBuilder, args.fOpts.fColorPOI, 547 if (!this->setupDstReadIfNecessary(*pipelineBuilder, args.fOpts, &args.fDstT exture,
549 args.fOpts.fCoveragePOI, &args.fDstTextur e,
550 batch->bounds())) { 548 batch->bounds())) {
551 return false; 549 return false;
552 } 550 }
553 551
554 if (!batch->installPipeline(args)) { 552 if (!batch->installPipeline(args)) {
555 return false; 553 return false;
556 } 554 }
557 555
558 return true; 556 return true;
559 } 557 }
560 558
561 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) { 559 void GrDrawTarget::clearStencilClip(const SkIRect& rect, bool insideClip, GrRend erTarget* rt) {
562 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt); 560 GrBatch* batch = new GrClearStencilClipBatch(rect, insideClip, rt);
563 this->recordBatch(batch); 561 this->recordBatch(batch);
564 batch->unref(); 562 batch->unref();
565 } 563 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698