| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTargetCommands.h" | 8 #include "GrTargetCommands.h" |
| 9 | 9 |
| 10 #include "GrColor.h" | 10 #include "GrColor.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 traceString = iodb->getCmdString(currCmdMarker); | 312 traceString = iodb->getCmdString(currCmdMarker); |
| 313 newMarker.fMarker = traceString.c_str(); | 313 newMarker.fMarker = traceString.c_str(); |
| 314 gpu->addGpuTraceMarker(&newMarker); | 314 gpu->addGpuTraceMarker(&newMarker); |
| 315 ++currCmdMarker; | 315 ++currCmdMarker; |
| 316 } | 316 } |
| 317 | 317 |
| 318 // TODO temporary hack | 318 // TODO temporary hack |
| 319 if (Cmd::kDrawBatch_Cmd == iter->type()) { | 319 if (Cmd::kDrawBatch_Cmd == iter->type()) { |
| 320 DrawBatch* db = reinterpret_cast<DrawBatch*>(iter.get()); | 320 DrawBatch* db = reinterpret_cast<DrawBatch*>(iter.get()); |
| 321 fBatchTarget.flushNext(db->fBatch->numberOfDraws()); | 321 fBatchTarget.flushNext(db->fBatch->numberOfDraws()); |
| 322 |
| 323 if (iter->isTraced()) { |
| 324 gpu->removeGpuTraceMarker(&newMarker); |
| 325 } |
| 322 continue; | 326 continue; |
| 323 } | 327 } |
| 324 | 328 |
| 325 if (Cmd::kSetState_Cmd == iter->type()) { | 329 if (Cmd::kSetState_Cmd == iter->type()) { |
| 326 SetState* ss = reinterpret_cast<SetState*>(iter.get()); | 330 SetState* ss = reinterpret_cast<SetState*>(iter.get()); |
| 327 | 331 |
| 328 // TODO sometimes we have a prim proc, othertimes we have a GrBatch.
Eventually we | 332 // TODO sometimes we have a prim proc, othertimes we have a GrBatch.
Eventually we |
| 329 // will only have GrBatch and we can delete this | 333 // will only have GrBatch and we can delete this |
| 330 if (ss->fPrimitiveProcessor) { | 334 if (ss->fPrimitiveProcessor) { |
| 331 gpu->buildProgramDesc(&ss->fDesc, *ss->fPrimitiveProcessor, | 335 gpu->buildProgramDesc(&ss->fDesc, *ss->fPrimitiveProcessor, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 fPrevState->getPipeline()->isEqual(*ss->getPipeline())) { | 467 fPrevState->getPipeline()->isEqual(*ss->getPipeline())) { |
| 464 fCmdBuffer.pop_back(); | 468 fCmdBuffer.pop_back(); |
| 465 } else { | 469 } else { |
| 466 this->closeBatch(); | 470 this->closeBatch(); |
| 467 fPrevState = ss; | 471 fPrevState = ss; |
| 468 iodb->recordTraceMarkersIfNecessary(ss); | 472 iodb->recordTraceMarkersIfNecessary(ss); |
| 469 } | 473 } |
| 470 return true; | 474 return true; |
| 471 } | 475 } |
| 472 | 476 |
| OLD | NEW |