Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/gpu/instanced/InstancedRendering.cpp

Issue 2143333002: Add resource provider flag to avoid client-side buffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add resource provider flag to avoid client-side buffers Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/instanced/GLInstancedRendering.cpp ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/instanced/GLInstancedRendering.cpp ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698