| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #include "GrInOrderCommandBuilder.h" | |
| 9 | |
| 10 #include "GrBufferedDrawTarget.h" | |
| 11 | |
| 12 #include "GrColor.h" | |
| 13 #include "SkPoint.h" | |
| 14 | |
| 15 GrTargetCommands::Cmd* GrInOrderCommandBuilder::recordDrawBatch(GrBatch* batch, | |
| 16 const GrCaps& ca
ps) { | |
| 17 GrBATCH_INFO("In-Recording (%s, %u)\n", batch->name(), batch->uniqueID()); | |
| 18 if (!this->cmdBuffer()->empty() && | |
| 19 Cmd::kDrawBatch_CmdType == this->cmdBuffer()->back().type()) { | |
| 20 DrawBatch* previous = static_cast<DrawBatch*>(&this->cmdBuffer()->back()
); | |
| 21 if (previous->batch()->combineIfPossible(batch, caps)) { | |
| 22 GrBATCH_INFO("\tBatching with (%s, %u)\n", | |
| 23 previous->batch()->name(), previous->batch()->uniqueID(
)); | |
| 24 return nullptr; | |
| 25 } | |
| 26 } | |
| 27 | |
| 28 return GrNEW_APPEND_TO_RECORDER(*this->cmdBuffer(), DrawBatch, (batch)); | |
| 29 } | |
| OLD | NEW |