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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 2182783004: Add test configs for instanced rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add test configs for instanced rendering 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawingManager.cpp
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 5dc07dd9604456f9ba92c1c02e460b24338e1823..840c50f5e02f5ea63f2a7300839ae3926eafcd8e 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -45,7 +45,8 @@ GrDrawingManager::~GrDrawingManager() {
void GrDrawingManager::abandon() {
fAbandoned = true;
for (int i = 0; i < fDrawTargets.count(); ++i) {
- if (InstancedRendering* ir = fDrawTargets[i]->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
+ InstancedRendering* ir = fDrawTargets[i]->instancedRendering();
ir->resetGpuResources(InstancedRendering::ResetType::kAbandon);
}
}
@@ -58,7 +59,8 @@ void GrDrawingManager::freeGpuResources() {
fPathRendererChain = nullptr;
SkSafeSetNull(fSoftwarePathRenderer);
for (int i = 0; i < fDrawTargets.count(); ++i) {
- if (InstancedRendering* ir = fDrawTargets[i]->instancedRendering()) {
+ if (GrCaps::InstancedSupport::kNone != fContext->caps()->instancedSupport()) {
+ InstancedRendering* ir = fDrawTargets[i]->instancedRendering();
ir->resetGpuResources(InstancedRendering::ResetType::kDestroy);
}
}
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698