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 "GrDrawBatch.h" |
| 9 |
| 10 GrDrawBatch::GrDrawBatch() : fPipelineInstalled(false) { } |
| 11 |
| 12 GrDrawBatch::~GrDrawBatch() { |
| 13 if (fPipelineInstalled) { |
| 14 this->pipeline()->~GrPipeline(); |
| 15 } |
| 16 } |
| 17 |
| 18 bool GrDrawBatch::installPipeline(const GrPipeline::CreateArgs& args) { |
| 19 GrPipelineOptimizations opts; |
| 20 void* location = fPipelineStorage.get(); |
| 21 if (!GrPipeline::CreateAt(location, args, &opts)) { |
| 22 return false; |
| 23 } |
| 24 this->initBatchTracker(opts); |
| 25 fPipelineInstalled = true; |
| 26 return true; |
| 27 } |
OLD | NEW |