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

Unified Diff: src/gpu/instanced/GLInstancedRendering.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/instanced/GLInstancedRendering.h ('k') | src/gpu/instanced/InstanceProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/instanced/GLInstancedRendering.cpp
diff --git a/src/gpu/instanced/GLInstancedRendering.cpp b/src/gpu/instanced/GLInstancedRendering.cpp
index 2962a865481b7d97bbdb07e051fd9afa14ec1d15..440796e19a16da6a0a24a66c256493ab59faf2c4 100644
--- a/src/gpu/instanced/GLInstancedRendering.cpp
+++ b/src/gpu/instanced/GLInstancedRendering.cpp
@@ -31,27 +31,21 @@ private:
typedef Batch INHERITED;
};
-GLInstancedRendering* GLInstancedRendering::CreateIfSupported(GrGLGpu* gpu) {
-#ifndef SK_BUILD_FOR_MAC
- // Only whitelisting on Mac for now. Once we've been able to work through the various issues on
- // other platforms we can enable more generally.
- return nullptr;
-#endif
- const GrGLCaps& glCaps = gpu->glCaps();
- AntialiasMode lastSupportedAAMode;
- if (!glCaps.vertexArrayObjectSupport() ||
- !glCaps.drawIndirectSupport() ||
- !InstanceProcessor::IsSupported(*glCaps.glslCaps(), glCaps, &lastSupportedAAMode)) {
- return nullptr;
+GrCaps::InstancedSupport GLInstancedRendering::CheckSupport(const GrGLCaps& glCaps) {
+ // This method is only intended to be used for initializing fInstancedSupport in the caps.
+ SkASSERT(GrCaps::InstancedSupport::kNone == glCaps.instancedSupport());
+ if (!glCaps.vertexArrayObjectSupport() || !glCaps.drawIndirectSupport()) {
+ return GrCaps::InstancedSupport::kNone;
}
- return new GLInstancedRendering(gpu, lastSupportedAAMode);
+ return InstanceProcessor::CheckSupport(*glCaps.glslCaps(), glCaps);
}
-GLInstancedRendering::GLInstancedRendering(GrGLGpu* gpu, AntialiasMode lastSupportedAAMode)
- : INHERITED(gpu, lastSupportedAAMode, gpu->glCaps().canDrawIndirectToFloat()),
+GLInstancedRendering::GLInstancedRendering(GrGLGpu* gpu)
+ : INHERITED(gpu),
fVertexArrayID(0),
fGLDrawCmdsInfo(0),
fInstanceAttribsBufferUniqueId(SK_InvalidUniqueID) {
+ SkASSERT(GrCaps::InstancedSupport::kNone != this->gpu()->caps()->instancedSupport());
}
GLInstancedRendering::~GLInstancedRendering() {
« no previous file with comments | « src/gpu/instanced/GLInstancedRendering.h ('k') | src/gpu/instanced/InstanceProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698