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

Unified Diff: src/gpu/GrDrawingManager.cpp

Issue 2066993003: Begin instanced rendering for simple shapes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rix perf regressions 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 458bd20571fafc332fff5cb2bd66accd1bde31f9..75ee0db7c8979a41bc24c3af2d9ef1efa17be952 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -13,9 +13,13 @@
#include "GrSoftwarePathRenderer.h"
#include "SkTTopoSort.h"
+#include "instanced/InstancedRendering.h"
+
#include "text/GrAtlasTextContext.h"
#include "text/GrStencilAndCoverTextContext.h"
+using gr_instanced::InstancedRendering;
+
void GrDrawingManager::cleanup() {
for (int i = 0; i < fDrawTargets.count(); ++i) {
fDrawTargets[i]->makeClosed(); // no drawTarget should receive a new command after this
@@ -40,6 +44,11 @@ GrDrawingManager::~GrDrawingManager() {
void GrDrawingManager::abandon() {
fAbandoned = true;
+ for (int i = 0; i < fDrawTargets.count(); ++i) {
+ if (InstancedRendering* ir = fDrawTargets[i]->instancedRendering()) {
+ ir->resetGpuResources(InstancedRendering::ResetType::kAbandon);
+ }
+ }
this->cleanup();
}
@@ -48,6 +57,11 @@ void GrDrawingManager::freeGpuResources() {
delete fPathRendererChain;
fPathRendererChain = nullptr;
SkSafeSetNull(fSoftwarePathRenderer);
+ for (int i = 0; i < fDrawTargets.count(); ++i) {
+ if (InstancedRendering* ir = fDrawTargets[i]->instancedRendering()) {
+ ir->resetGpuResources(InstancedRendering::ResetType::kDestroy);
+ }
+ }
}
void GrDrawingManager::reset() {
« 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