| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "InstancedRendering.h" | 8 #include "InstancedRendering.h" |
| 9 | 9 |
| 10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 if (!fIndexBuffer) { | 445 if (!fIndexBuffer) { |
| 446 fIndexBuffer.reset(InstanceProcessor::FindOrCreateIndex8Buffer(fGpu)); | 446 fIndexBuffer.reset(InstanceProcessor::FindOrCreateIndex8Buffer(fGpu)); |
| 447 if (!fIndexBuffer) { | 447 if (!fIndexBuffer) { |
| 448 return; | 448 return; |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 if (!fParams.empty()) { | 452 if (!fParams.empty()) { |
| 453 fParamsBuffer.reset(rp->createBuffer(fParams.count() * sizeof(ParamsTexe
l), | 453 fParamsBuffer.reset(rp->createBuffer(fParams.count() * sizeof(ParamsTexe
l), |
| 454 kTexel_GrBufferType, kDynamic_GrAcc
essPattern, | 454 kTexel_GrBufferType, kDynamic_GrAcc
essPattern, |
| 455 GrResourceProvider::kNoPendingIO_Fl
ag, | 455 GrResourceProvider::kNoPendingIO_Fl
ag | |
| 456 GrResourceProvider::kRequireGpuMemo
ry_Flag, |
| 456 fParams.begin())); | 457 fParams.begin())); |
| 457 if (!fParamsBuffer) { | 458 if (!fParamsBuffer) { |
| 458 return; | 459 return; |
| 459 } | 460 } |
| 460 } | 461 } |
| 461 | 462 |
| 462 this->onBeginFlush(rp); | 463 this->onBeginFlush(rp); |
| 463 } | 464 } |
| 464 | 465 |
| 465 void InstancedRendering::Batch::onDraw(GrBatchFlushState* state) { | 466 void InstancedRendering::Batch::onDraw(GrBatchFlushState* state) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 487 } | 488 } |
| 488 | 489 |
| 489 void InstancedRendering::resetGpuResources(ResetType resetType) { | 490 void InstancedRendering::resetGpuResources(ResetType resetType) { |
| 490 fVertexBuffer.reset(); | 491 fVertexBuffer.reset(); |
| 491 fIndexBuffer.reset(); | 492 fIndexBuffer.reset(); |
| 492 fParamsBuffer.reset(); | 493 fParamsBuffer.reset(); |
| 493 this->onResetGpuResources(resetType); | 494 this->onResetGpuResources(resetType); |
| 494 } | 495 } |
| 495 | 496 |
| 496 } | 497 } |
| OLD | NEW |