Commit cb41ac84 authored by owenlin@chromium.org's avatar owenlin@chromium.org

rendering_helper - Use real GLSurface and GLContext.

BUG=None
TEST=Run the vda_unitest on GLX and EGL machines.

Review URL: https://codereview.chromium.org/400353007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284628 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ee72da1
...@@ -14,20 +14,14 @@ ...@@ -14,20 +14,14 @@
#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_bindings.h" #include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_surface.h"
namespace base { namespace base {
class MessageLoop; class MessageLoop;
class WaitableEvent; class WaitableEvent;
} }
#if !defined(OS_WIN) && defined(ARCH_CPU_X86_FAMILY)
#define GL_VARIANT_GLX 1
typedef GLXContext NativeContextType;
#else
#define GL_VARIANT_EGL 1
typedef EGLContext NativeContextType;
#endif
namespace content { namespace content {
struct RenderingHelperParams; struct RenderingHelperParams;
...@@ -53,6 +47,8 @@ class RenderingHelper { ...@@ -53,6 +47,8 @@ class RenderingHelper {
RenderingHelper(); RenderingHelper();
~RenderingHelper(); ~RenderingHelper();
static bool InitializeOneOff();
// Create the render context and windows by the specified dimensions. // Create the render context and windows by the specified dimensions.
void Initialize(const RenderingHelperParams& params, void Initialize(const RenderingHelperParams& params,
base::WaitableEvent* done); base::WaitableEvent* done);
...@@ -82,7 +78,7 @@ class RenderingHelper { ...@@ -82,7 +78,7 @@ class RenderingHelper {
void* GetGLDisplay(); void* GetGLDisplay();
// Get the platform specific handle to the OpenGL context. // Get the platform specific handle to the OpenGL context.
NativeContextType GetGLContext(); void* GetGLContext();
// Get rendered thumbnails as RGB. // Get rendered thumbnails as RGB.
// Sets alpha_solid to true if the alpha channel is entirely 0xff. // Sets alpha_solid to true if the alpha channel is entirely 0xff.
...@@ -101,21 +97,10 @@ class RenderingHelper { ...@@ -101,21 +97,10 @@ class RenderingHelper {
scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_; scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_;
base::MessageLoop* message_loop_; base::MessageLoop* message_loop_;
NativeContextType gl_context_; scoped_refptr<gfx::GLContext> gl_context_;
scoped_refptr<gfx::GLSurface> gl_surface_;
#if defined(GL_VARIANT_EGL)
EGLDisplay gl_display_; gfx::AcceleratedWidget window_;
EGLSurface gl_surface_;
#else
XVisualInfo* x_visual_;
#endif
#if defined(OS_WIN)
HWND window_;
#else
Display* x_display_;
Window x_window_;
#endif
gfx::Size screen_size_; gfx::Size screen_size_;
......
...@@ -1460,6 +1460,7 @@ int main(int argc, char **argv) { ...@@ -1460,6 +1460,7 @@ int main(int argc, char **argv) {
} }
base::ShadowingAtExitManager at_exit_manager; base::ShadowingAtExitManager at_exit_manager;
content::RenderingHelper::InitializeOneOff();
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment