aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-21 17:57:55 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-21 17:57:55 +0000
commitf6f123d23608a4a5fe9c812d2452039a18da7e0b (patch)
tree2ce9c1b548b14dcf47fa5f8e77d170580cfe0e3a /gm
parent008c498b58e674c6fe595a359e3adbafddd05540 (diff)
Added tracking of frame buffer objects to debug GL interface
Diffstat (limited to 'gm')
-rw-r--r--gm/gmmain.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 1e63bb6d77..bcceb727c2 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -21,6 +21,7 @@
#include "SkImageEncoder.h"
#include "gl/SkNativeGLContext.h"
#include "gl/SkMesaGLContext.h"
+#include "gl/SkDebugGLContext.h"
#include "SkPicture.h"
#include "SkStream.h"
#include "SkRefCnt.h"
@@ -606,11 +607,12 @@ static void usage(const char * argv0) {
SkDebugf(
"%s [-w writePath] [-r readPath] [-d diffPath] [-i resourcePath]\n"
" [--noreplay] [--serialize] [--forceBWtext] [--nopdf] \n"
- " [--nodeferred] [--match substring] [--notexturecache]"
+ " [--nodeferred] [--match substring] [--notexturecache]\n"
+ " "
#if SK_MESA
- " [--mesagl]"
+ "[--mesagl]"
#endif
- "\n\n", argv0);
+ " [--debuggl]\n\n", argv0);
SkDebugf(" writePath: directory to write rendered images in.\n");
SkDebugf(
" readPath: directory to read reference images from;\n"
@@ -627,6 +629,7 @@ static void usage(const char * argv0) {
#if SK_MESA
SkDebugf(" --mesagl will run using the osmesa sw gl rasterizer.\n");
#endif
+ SkDebugf(" --debuggl will run using the debugging gl utility.\n");
SkDebugf(" --notexturecache: disable the gpu texture cache.\n");
}
@@ -684,6 +687,7 @@ int main(int argc, char * const argv[]) {
bool doReplay = true;
bool doSerialize = false;
bool useMesa = false;
+ bool useDebugGL = false;
bool doDeferred = true;
bool disableTextureCache = false;
@@ -730,6 +734,8 @@ int main(int argc, char * const argv[]) {
} else if (strcmp(*argv, "--mesagl") == 0) {
useMesa = true;
#endif
+ } else if (strcmp(*argv, "--debuggl") == 0) {
+ useDebugGL = true;
} else if (strcmp(*argv, "--notexturecache") == 0) {
disableTextureCache = true;
} else {
@@ -763,7 +769,9 @@ int main(int argc, char * const argv[]) {
glContext.reset(new SkMesaGLContext());
} else
#endif
- {
+ if (useDebugGL) {
+ glContext.reset(new SkDebugGLContext());
+ } else {
glContext.reset(new SkNativeGLContext());
}
@@ -893,5 +901,9 @@ int main(int argc, char * const argv[]) {
}
printf("Ran %d tests: %d passed, %d failed, %d missing reference images\n",
testsRun, testsPassed, testsFailed, testsMissingReferenceImages);
+
+ SkDELETE(skiagm::gGrContext);
+ skiagm::gGrContext = NULL;
+
return (0 == testsFailed) ? 0 : -1;
}