Revert of Support using OpenGL ES context on desktop (https://codereview.chromium.org/319043005/)
Reason for revert:
Caused segmentation fault on many builders. Please see reverted CL's msg #21 for details.
Original issue's description:
> Support using OpenGL ES context on desktop
>
> Support using OpenGL ES context on desktop for unix and Android platforms. This
> is mainly useful in development.
>
> Add --gpuAPI flag to gm, dm, bench, bench_pictures and render_pictures. The
> possible parameters for the flag are "gl" and "gles".
>
> Committed: https://skia.googlesource.com/skia/+/74fc727dc88ee24d89f88cb1709f963e9073aeb3
R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com, kkinnunen@nvidia.com
TBR=bsalomon@google.com, kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
Author: rmistry@google.com
Review URL: https://codereview.chromium.org/351583002
diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h
index b4e08aa..efe118f 100644
--- a/tools/PictureRenderer.h
+++ b/tools/PictureRenderer.h
@@ -165,11 +165,7 @@
/**
* Set the backend type. Returns true on success and false on failure.
*/
-#if SK_SUPPORT_GPU
- bool setDeviceType(SkDeviceTypes deviceType, GrGLStandard gpuAPI = kNone_GrGLStandard) {
-#else
bool setDeviceType(SkDeviceTypes deviceType) {
-#endif
fDeviceType = deviceType;
#if SK_SUPPORT_GPU
// In case this function is called more than once
@@ -204,7 +200,7 @@
return false;
}
#if SK_SUPPORT_GPU
- fGrContext = fGrContextFactory.get(glContextType, gpuAPI);
+ fGrContext = fGrContextFactory.get(glContextType);
if (NULL == fGrContext) {
return false;
} else {
diff --git a/tools/PictureRenderingFlags.cpp b/tools/PictureRenderingFlags.cpp
index 4ffa16f..5acec26 100644
--- a/tools/PictureRenderingFlags.cpp
+++ b/tools/PictureRenderingFlags.cpp
@@ -26,8 +26,6 @@
#if SK_SUPPORT_GPU
-static const char kGpuAPINameGL[] = "gl";
-static const char kGpuAPINameGLES[] = "gles";
#define GPU_CONFIG_STRING "|gpu|msaa4|msaa16|nvprmsaa4|nvprmsaa16"
#else
#define GPU_CONFIG_STRING ""
@@ -76,12 +74,6 @@
DEFINE_string(tiles, "", "Used with --mode copyTile to specify number of tiles per larger tile "
"in the x and y directions.");
DEFINE_string(viewport, "", "width height: Set the viewport.");
-#if SK_SUPPORT_GPU
-DEFINE_string(gpuAPI, "", "Force use of specific gpu API. Using \"gl\" "
- "forces OpenGL API. Using \"gles\" forces OpenGL ES API. "
- "Defaults to empty string, which selects the API native to the "
- "system.");
-#endif
sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) {
error.reset();
@@ -269,21 +261,6 @@
sk_tools::PictureRenderer::SkDeviceTypes deviceType =
sk_tools::PictureRenderer::kBitmap_DeviceType;
#if SK_SUPPORT_GPU
- GrGLStandard gpuAPI = kNone_GrGLStandard;
- if (1 == FLAGS_gpuAPI.count()) {
- if (FLAGS_gpuAPI.contains(kGpuAPINameGL)) {
- gpuAPI = kGL_GrGLStandard;
- } else if (FLAGS_gpuAPI.contains(kGpuAPINameGLES)) {
- gpuAPI = kGLES_GrGLStandard;
- } else {
- error.printf("--gpuAPI invalid api value.\n");
- return NULL;
- }
- } else if (FLAGS_gpuAPI.count() > 1) {
- error.printf("--gpuAPI invalid api value.\n");
- return NULL;
- }
-
int sampleCount = 0;
#endif
if (FLAGS_config.count() > 0) {
@@ -353,14 +330,7 @@
error.printf("%s is not a valid mode for --config\n", FLAGS_config[0]);
return NULL;
}
-#if SK_SUPPORT_GPU
- if (!renderer->setDeviceType(deviceType, gpuAPI)) {
-#else
- if (!renderer->setDeviceType(deviceType)) {
-#endif
- error.printf("Could not create backend for --config %s\n", FLAGS_config[0]);
- return NULL;
- }
+ renderer->setDeviceType(deviceType);
#if SK_SUPPORT_GPU
renderer->setSampleCount(sampleCount);
#endif