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