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

Unified Diff: samplecode/SampleApp.cpp

Issue 1306823003: skia: add ability to load command_buffer_gles2 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: and NULL->nullptr, just because. Created 5 years, 4 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 | « samplecode/SampleApp.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 44daeb63a1d110d880d47ee922881fdfcc06b610..52050071146bc071c56d26b76dfe8eb6f015b28d 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -81,7 +81,9 @@ public:
SkTCPServer gServer;
#endif
-#if SK_ANGLE
+#if SK_COMMAND_BUFFER
+#define DEFAULT_TO_COMMAND_BUFFER 1
+#elif SK_ANGLE
//#define DEFAULT_TO_ANGLE 1
#else
#define DEFAULT_TO_GPU 0 // if 1 default rendering is on GPU
@@ -197,6 +199,12 @@ public:
fBackend = kANGLE_BackEndType;
break;
#endif // SK_ANGLE
+#if SK_COMMAND_BUFFER
+ case kCommandBuffer_DeviceType:
+ // Command buffer is really the only other odd man out :D
+ fBackend = kCommandBuffer_BackEndType;
+ break;
+#endif // SK_COMMAND_BUFFER
default:
SkASSERT(false);
break;
@@ -223,6 +231,11 @@ public:
glInterface.reset(GrGLCreateANGLEInterface());
break;
#endif // SK_ANGLE
+#if SK_COMMAND_BUFFER
+ case kCommandBuffer_DeviceType:
+ glInterface.reset(GrGLCreateCommandBufferInterface());
+ break;
+#endif // SK_COMMAND_BUFFER
default:
SkASSERT(false);
break;
@@ -670,6 +683,9 @@ static inline SampleWindow::DeviceType cycle_devicetype(SampleWindow::DeviceType
#if SK_ANGLE
SampleWindow::kANGLE_DeviceType,
#endif // SK_ANGLE
+#if SK_COMMAND_BUFFER
+ SampleWindow::kCommandBuffer_DeviceType,
+#endif // SK_COMMAND_BUFFER
#endif // SK_SUPPORT_GPU
SampleWindow::kRaster_DeviceType,
};
@@ -790,6 +806,9 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
#if SK_ANGLE && DEFAULT_TO_ANGLE
fDeviceType = kANGLE_DeviceType;
#endif
+#if SK_COMMAND_BUFFER && DEFAULT_TO_COMMAND_BUFFER
+ fDeviceType = kCommandBuffer_DeviceType;
+#endif
fUseClip = false;
fAnimating = false;
@@ -830,6 +849,9 @@ SampleWindow::SampleWindow(void* hwnd, int argc, char** argv, DeviceManager* dev
#if SK_ANGLE
"ANGLE",
#endif
+#if SK_COMMAND_BUFFER
+ "Command Buffer",
+#endif
nullptr);
fAppMenu->assignKeyEquivalentToItem(itemID, 'd');
itemID = fAppMenu->appendTriState("AA", "AA", sinkID, fAAState);
@@ -1939,6 +1961,9 @@ static const char* gDeviceTypePrefix[] = {
#if SK_ANGLE
"angle: ",
#endif // SK_ANGLE
+#if SK_COMMAND_BUFFER
+ "command buffer: ",
+#endif // SK_COMMAND_BUFFER
#endif // SK_SUPPORT_GPU
};
static_assert(SK_ARRAY_COUNT(gDeviceTypePrefix) == SampleWindow::kDeviceTypeCnt,
« no previous file with comments | « samplecode/SampleApp.h ('k') | src/gpu/GrContextFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698