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 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_surface.h"
namespace base {
class MessageLoop;
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 {
struct RenderingHelperParams;
......@@ -53,6 +47,8 @@ class RenderingHelper {
RenderingHelper();
~RenderingHelper();
static bool InitializeOneOff();
// Create the render context and windows by the specified dimensions.
void Initialize(const RenderingHelperParams& params,
base::WaitableEvent* done);
......@@ -82,7 +78,7 @@ class RenderingHelper {
void* GetGLDisplay();
// Get the platform specific handle to the OpenGL context.
NativeContextType GetGLContext();
void* GetGLContext();
// Get rendered thumbnails as RGB.
// Sets alpha_solid to true if the alpha channel is entirely 0xff.
......@@ -101,21 +97,10 @@ class RenderingHelper {
scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_;
base::MessageLoop* message_loop_;
NativeContextType gl_context_;
#if defined(GL_VARIANT_EGL)
EGLDisplay gl_display_;
EGLSurface gl_surface_;
#else
XVisualInfo* x_visual_;
#endif
#if defined(OS_WIN)
HWND window_;
#else
Display* x_display_;
Window x_window_;
#endif
scoped_refptr<gfx::GLContext> gl_context_;
scoped_refptr<gfx::GLSurface> gl_surface_;
gfx::AcceleratedWidget window_;
gfx::Size screen_size_;
......
......@@ -1460,6 +1460,7 @@ int main(int argc, char **argv) {
}
base::ShadowingAtExitManager at_exit_manager;
content::RenderingHelper::InitializeOneOff();
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