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

Unified Diff: src/gpu/GrReorderCommandBuilder.cpp

Issue 1282893002: Make initBatchTracker private, move towards pipeline on batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months 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 | « src/gpu/GrReorderCommandBuilder.h ('k') | src/gpu/GrTargetCommands.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrReorderCommandBuilder.cpp
diff --git a/src/gpu/GrReorderCommandBuilder.cpp b/src/gpu/GrReorderCommandBuilder.cpp
index c7b5f97da4949e6af9bc9157f837845ea3e0a33d..4f2685532b43ea1736617f067ae209adbdfd207e 100644
--- a/src/gpu/GrReorderCommandBuilder.cpp
+++ b/src/gpu/GrReorderCommandBuilder.cpp
@@ -15,7 +15,9 @@ static bool intersect(const Left& a, const Right& b) {
a.fTop < b.fBottom && b.fTop < a.fBottom;
}
-GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, GrBatch* batch) {
+GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(const State* state,
+ const GrPipelineOptimizations& opts,
+ GrBatch* batch) {
// Check if there is a Batch Draw we can batch with by linearly searching back until we either
// 1) check every draw
// 2) intersect with something
@@ -23,7 +25,7 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr
// Experimentally we have found that most batching occurs within the first 10 comparisons.
static const int kMaxLookback = 10;
int i = 0;
brucedawson 2015/08/11 18:57:39 If this variable was declared on line 52 then it w
- batch->setPipeline(state->getPipeline());
+ batch->setPipeline(state->getPipeline(), opts);
GrRenderTarget* rt = state->getPipeline()->getRenderTarget();
GrBATCH_INFO("Re-Recording (%s, B%u)\n"
@@ -33,17 +35,17 @@ GrTargetCommands::Cmd* GrReorderCommandBuilder::recordDrawBatch(State* state, Gr
batch->uniqueID(), rt,
batch->bounds().fLeft, batch->bounds().fRight,
batch->bounds().fTop, batch->bounds().fBottom);
-#if GR_BATCH_SPEW
- SkDebugf("\tColorStages:\n");
- for (int i = 0; i < state->getPipeline()->numColorFragmentStages(); i++) {
- SkDebugf("\t\t%s\n", state->getPipeline()->getColorStage(i).processor()->name());
- }
- SkDebugf("\tCoverageStages:\n");
- for (int i = 0; i < state->getPipeline()->numCoverageFragmentStages(); i++) {
- SkDebugf("\t\t%s\n", state->getPipeline()->getCoverageStage(i).processor()->name());
+ if (GR_BATCH_SPEW) {
+ SkDebugf("\tColorStages:\n");
+ for (int i = 0; i < state->getPipeline()->numColorFragmentStages(); i++) {
+ SkDebugf("\t\t%s\n", state->getPipeline()->getColorStage(i).processor()->name());
+ }
+ SkDebugf("\tCoverageStages:\n");
+ for (int i = 0; i < state->getPipeline()->numCoverageFragmentStages(); i++) {
+ SkDebugf("\t\t%s\n", state->getPipeline()->getCoverageStage(i).processor()->name());
+ }
+ SkDebugf("\tXP: %s\n", state->getPipeline()->getXferProcessor()->name());
}
- SkDebugf("\tXP: %s\n", state->getPipeline()->getXferProcessor()->name());
-#endif
GrBATCH_INFO("\tOutcome:\n");
if (!this->cmdBuffer()->empty()) {
GrTargetCommands::CmdBuffer::ReverseIter reverseIter(*this->cmdBuffer());
« no previous file with comments | « src/gpu/GrReorderCommandBuilder.h ('k') | src/gpu/GrTargetCommands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698