From c2751189951618b8a7b908d30083bb8a5efb7e52 Mon Sep 17 00:00:00 2001 From: "gman@chromium.org" Date: Mon, 19 Jul 2010 08:29:16 +0000 Subject: 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 --- gpu/command_buffer/client/gles2_demo.cc | 10 ++++++++++ gpu/command_buffer/client/gles2_demo_cc.cc | 1 + gpu/command_buffer/common/gles2_cmd_utils.cc | 2 ++ 3 files changed, 13 insertions(+) (limited to 'gpu') 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 #include #include +#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 +#include #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: -- cgit v1.1