diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-19 08:29:16 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-19 08:29:16 +0000 |
commit | c2751189951618b8a7b908d30083bb8a5efb7e52 (patch) | |
tree | 736459fed54f23899b40626e11f68651544be943 /gpu/command_buffer | |
parent | f4d7feacd341fcdf796882be07a486ae62ccdd84 (diff) | |
download | chromium_src-c2751189951618b8a7b908d30083bb8a5efb7e52.zip chromium_src-c2751189951618b8a7b908d30083bb8a5efb7e52.tar.gz chromium_src-c2751189951618b8a7b908d30083bb8a5efb7e52.tar.bz2 |
Fix the gles2_demo to work with latest gpu process
stuff. Also added GL_BGRA_EXT to ElementsPerGroup
TEST=hand ran gles2_demo
BUG=none
Review URL: http://codereview.chromium.org/2888016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/client/gles2_demo.cc | 10 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_demo_cc.cc | 1 | ||||
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 365cf53..1cfeaca 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -12,7 +12,9 @@ #include <shellapi.h> #include <stdlib.h> #include <stdio.h> +#include "app/gfx/gl/gl_context.h" #include "base/at_exit.h" +#include "base/command_line.h" #include "base/callback.h" #include "base/message_loop.h" #include "base/ref_counted.h" @@ -192,15 +194,23 @@ int WINAPI WinMain(HINSTANCE instance, LPSTR command_line, int command_show) { g_instance = instance; + int argc = 1; + const char* const argv[] = { + "gles2_demo.exe" + }; + #else int main(int argc, char** argv) { #endif + CommandLine::Init(argc, argv); const int32 kCommandBufferSize = 1024 * 1024; base::AtExitManager at_exit_manager; MessageLoopForUI message_loop; + gfx::GLContext::InitializeOneOff(); + GLES2Demo* demo = new GLES2Demo(); void* hwnd = SetupWindow(); diff --git a/gpu/command_buffer/client/gles2_demo_cc.cc b/gpu/command_buffer/client/gles2_demo_cc.cc index acb5be3..1e11383 100644 --- a/gpu/command_buffer/client/gles2_demo_cc.cc +++ b/gpu/command_buffer/client/gles2_demo_cc.cc @@ -74,6 +74,7 @@ void InitShaders() { " texCoord = g_TexCoord0;\n" "}\n"; static const char* fShaderStr = + "precision mediump float;" "uniform sampler2D tex;\n" "varying vec2 texCoord;\n" "void main()\n" diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 0f281ec..b51c8c5 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -6,6 +6,7 @@ // includes where appropriate. #include <GLES2/gl2.h> +#include <GLES2/gles2_command_buffer.h> #include "../common/gles2_cmd_utils.h" #include "../common/gles2_cmd_format.h" @@ -314,6 +315,7 @@ int ElementsPerGroup(int format, int type) { case GL_LUMINANCE_ALPHA: return 2; case GL_RGBA: + case GL_BGRA_EXT: return 4; case GL_ALPHA: case GL_LUMINANCE: |