summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 00:07:21 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 00:07:21 +0000
commit52dd2f8464089b5b1f5c69c7ce32a9431549394b (patch)
tree717d67fcc4a123d9e9f6e441fdf46242be167861 /ui
parentd639366249df2e1e0e27911c3b1da585fd2fe35f (diff)
downloadchromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.zip
chromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.tar.gz
chromium_src-52dd2f8464089b5b1f5c69c7ce32a9431549394b.tar.bz2
Change PluginWindowHandle to AcceleratedWidget in ui/gfx/gl
BUG=104551 TEST=compile Review URL: http://codereview.chromium.org/9160012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/compositor/compositor.cc9
-rw-r--r--ui/gfx/gl/gl_context_nsview.mm6
-rw-r--r--ui/gfx/gl/gl_surface.h2
-rw-r--r--ui/gfx/gl/gl_surface_android.cc2
-rw-r--r--ui/gfx/gl/gl_surface_egl.cc2
-rw-r--r--ui/gfx/gl/gl_surface_egl.h4
-rw-r--r--ui/gfx/gl/gl_surface_glx.cc4
-rw-r--r--ui/gfx/gl/gl_surface_glx.h6
-rw-r--r--ui/gfx/gl/gl_surface_linux.cc8
-rw-r--r--ui/gfx/gl/gl_surface_mac.cc4
-rw-r--r--ui/gfx/gl/gl_surface_nsview.h6
-rw-r--r--ui/gfx/gl/gl_surface_nsview.mm4
-rw-r--r--ui/gfx/gl/gl_surface_wgl.cc4
-rw-r--r--ui/gfx/gl/gl_surface_wgl.h8
-rw-r--r--ui/gfx/gl/gl_surface_win.cc8
-rw-r--r--ui/gfx/native_widget_types.h13
16 files changed, 41 insertions, 49 deletions
diff --git a/ui/gfx/compositor/compositor.cc b/ui/gfx/compositor/compositor.cc
index 6dd9fc3..54d5b80 100644
--- a/ui/gfx/compositor/compositor.cc
+++ b/ui/gfx/compositor/compositor.cc
@@ -254,19 +254,10 @@ WebKit::WebGraphicsContext3D* Compositor::createContext3D() {
// Use context that results in no rendering to the screen.
context = new TestWebGraphicsContext3D();
} else {
-#if defined(OS_MACOSX) && !defined(USE_AURA)
- // Non-Aura builds compile this code but doesn't call it. Unfortunately
- // this is where we translate gfx::AcceleratedWidget to
- // gfx::PluginWindowHandle, and they are different on non-Aura Mac.
- // TODO(piman): remove ifdefs when AcceleratedWidget is rationalized on Mac.
- NOTIMPLEMENTED();
- return NULL;
-#else
gfx::GLShareGroup* share_group =
SharedResources::GetInstance()->GetShareGroup();
context = new webkit::gpu::WebGraphicsContext3DInProcessImpl(
widget_, share_group);
-#endif
}
WebKit::WebGraphicsContext3D::Attributes attrs;
context->initialize(attrs, 0, true);
diff --git a/ui/gfx/gl/gl_context_nsview.mm b/ui/gfx/gl/gl_context_nsview.mm
index c6d9a97..76c456c 100644
--- a/ui/gfx/gl/gl_context_nsview.mm
+++ b/ui/gfx/gl/gl_context_nsview.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -54,8 +54,8 @@ void GLContextNSView::Destroy() {
}
bool GLContextNSView::MakeCurrent(GLSurface* surface) {
- PluginWindowHandle view =
- static_cast<PluginWindowHandle>(surface->GetHandle());
+ AcceleratedWidget view =
+ static_cast<AcceleratedWidget>(surface->GetHandle());
// Only set the context's view if the view is parented.
// I.e. it is a valid drawable.
if ([view window])
diff --git a/ui/gfx/gl/gl_surface.h b/ui/gfx/gl/gl_surface.h
index a42afab..ca2b8df 100644
--- a/ui/gfx/gl/gl_surface.h
+++ b/ui/gfx/gl/gl_surface.h
@@ -92,7 +92,7 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// Create a GL surface that renders directly to a view.
static scoped_refptr<GLSurface> CreateViewGLSurface(
bool software,
- gfx::PluginWindowHandle window);
+ gfx::AcceleratedWidget window);
// Create a GL surface used for offscreen rendering.
static scoped_refptr<GLSurface> CreateOffscreenGLSurface(
diff --git a/ui/gfx/gl/gl_surface_android.cc b/ui/gfx/gl/gl_surface_android.cc
index 7c7dbca..fcb132d 100644
--- a/ui/gfx/gl/gl_surface_android.cc
+++ b/ui/gfx/gl/gl_surface_android.cc
@@ -38,7 +38,7 @@ bool GLSurface::InitializeOneOffInternal() {
}
// static
scoped_refptr<GLSurface>
-GLSurface::CreateViewGLSurface(bool software, gfx::PluginWindowHandle window) {
+GLSurface::CreateViewGLSurface(bool software, gfx::AcceleratedWidget window) {
if (software)
return NULL;
diff --git a/ui/gfx/gl/gl_surface_egl.cc b/ui/gfx/gl/gl_surface_egl.cc
index 438164d..7f4fb36 100644
--- a/ui/gfx/gl/gl_surface_egl.cc
+++ b/ui/gfx/gl/gl_surface_egl.cc
@@ -179,7 +179,7 @@ EGLNativeDisplayType GLSurfaceEGL::GetNativeDisplay() {
}
NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software,
- gfx::PluginWindowHandle window)
+ gfx::AcceleratedWidget window)
: window_(window),
surface_(NULL),
supports_post_sub_buffer_(false)
diff --git a/ui/gfx/gl/gl_surface_egl.h b/ui/gfx/gl/gl_surface_egl.h
index aff6b31..2be03c2 100644
--- a/ui/gfx/gl/gl_surface_egl.h
+++ b/ui/gfx/gl/gl_surface_egl.h
@@ -56,7 +56,7 @@ class GL_EXPORT GLSurfaceEGL : public GLSurface {
// Encapsulates an EGL surface bound to a view.
class NativeViewGLSurfaceEGL : public GLSurfaceEGL {
public:
- NativeViewGLSurfaceEGL(bool software, gfx::PluginWindowHandle window);
+ NativeViewGLSurfaceEGL(bool software, gfx::AcceleratedWidget window);
virtual ~NativeViewGLSurfaceEGL();
// Implement GLSurface.
@@ -73,7 +73,7 @@ class NativeViewGLSurfaceEGL : public GLSurfaceEGL {
void SetHandle(EGLSurface surface);
private:
- gfx::PluginWindowHandle window_;
+ gfx::AcceleratedWidget window_;
EGLSurface surface_;
bool supports_post_sub_buffer_;
diff --git a/ui/gfx/gl/gl_surface_glx.cc b/ui/gfx/gl/gl_surface_glx.cc
index 57043bc..09c4507 100644
--- a/ui/gfx/gl/gl_surface_glx.cc
+++ b/ui/gfx/gl/gl_surface_glx.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -103,7 +103,7 @@ void* GLSurfaceGLX::GetDisplay() {
return g_display;
}
-NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::PluginWindowHandle window)
+NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window)
: window_(window),
config_(NULL) {
}
diff --git a/ui/gfx/gl/gl_surface_glx.h b/ui/gfx/gl/gl_surface_glx.h
index ca30129..c226068 100644
--- a/ui/gfx/gl/gl_surface_glx.h
+++ b/ui/gfx/gl/gl_surface_glx.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -43,7 +43,7 @@ class GL_EXPORT GLSurfaceGLX : public GLSurface {
// A surface used to render to a view.
class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
public:
- explicit NativeViewGLSurfaceGLX(gfx::PluginWindowHandle window);
+ explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window);
virtual ~NativeViewGLSurfaceGLX();
// Implement GLSurfaceGLX.
@@ -60,7 +60,7 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX {
protected:
NativeViewGLSurfaceGLX();
- gfx::PluginWindowHandle window_;
+ gfx::AcceleratedWidget window_;
private:
void* config_;
diff --git a/ui/gfx/gl/gl_surface_linux.cc b/ui/gfx/gl/gl_surface_linux.cc
index a6771d9..8273c7a 100644
--- a/ui/gfx/gl/gl_surface_linux.cc
+++ b/ui/gfx/gl/gl_surface_linux.cc
@@ -31,7 +31,7 @@ Display* g_osmesa_display;
// view.
class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
public:
- explicit NativeViewGLSurfaceOSMesa(gfx::PluginWindowHandle window);
+ explicit NativeViewGLSurfaceOSMesa(gfx::AcceleratedWidget window);
virtual ~NativeViewGLSurfaceOSMesa();
static bool InitializeOneOff();
@@ -47,7 +47,7 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
private:
GC window_graphics_context_;
- gfx::PluginWindowHandle window_;
+ gfx::AcceleratedWidget window_;
GC pixmap_graphics_context_;
Pixmap pixmap_;
@@ -88,7 +88,7 @@ bool GLSurface::InitializeOneOffInternal() {
#if !defined(USE_WAYLAND)
NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
- gfx::PluginWindowHandle window)
+ gfx::AcceleratedWidget window)
: GLSurfaceOSMesa(OSMESA_BGRA, gfx::Size(1, 1)),
window_graphics_context_(0),
window_(window),
@@ -276,7 +276,7 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
- gfx::PluginWindowHandle window) {
+ gfx::AcceleratedWidget window) {
if (software)
return NULL;
diff --git a/ui/gfx/gl/gl_surface_mac.cc b/ui/gfx/gl/gl_surface_mac.cc
index aeb3366..30ad6b7 100644
--- a/ui/gfx/gl/gl_surface_mac.cc
+++ b/ui/gfx/gl/gl_surface_mac.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,7 +36,7 @@ bool GLSurface::InitializeOneOffInternal() {
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
- gfx::PluginWindowHandle window) {
+ gfx::AcceleratedWidget window) {
#if defined(USE_AURA)
if (software)
return NULL;
diff --git a/ui/gfx/gl/gl_surface_nsview.h b/ui/gfx/gl/gl_surface_nsview.h
index a53eaf1..67b4e26 100644
--- a/ui/gfx/gl/gl_surface_nsview.h
+++ b/ui/gfx/gl/gl_surface_nsview.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,7 +18,7 @@ class GLContextNSView;
// class, and the NSView is expected to use this context for drawing.
class GLSurfaceNSView : public GLSurface {
public:
- explicit GLSurfaceNSView(PluginWindowHandle view);
+ explicit GLSurfaceNSView(AcceleratedWidget view);
virtual ~GLSurfaceNSView();
// GLSurface:
@@ -33,7 +33,7 @@ class GLSurfaceNSView : public GLSurface {
private:
// Weak. An |NSView*|.
- PluginWindowHandle view_;
+ AcceleratedWidget view_;
// Weak. Associated context.
GLContextNSView* context_;
diff --git a/ui/gfx/gl/gl_surface_nsview.mm b/ui/gfx/gl/gl_surface_nsview.mm
index e03cb3b..455be56 100644
--- a/ui/gfx/gl/gl_surface_nsview.mm
+++ b/ui/gfx/gl/gl_surface_nsview.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,7 +11,7 @@
namespace gfx {
-GLSurfaceNSView::GLSurfaceNSView(PluginWindowHandle view)
+GLSurfaceNSView::GLSurfaceNSView(AcceleratedWidget view)
: view_(view),
context_(NULL) {
}
diff --git a/ui/gfx/gl/gl_surface_wgl.cc b/ui/gfx/gl/gl_surface_wgl.cc
index f34cf41..3d7571d 100644
--- a/ui/gfx/gl/gl_surface_wgl.cc
+++ b/ui/gfx/gl/gl_surface_wgl.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -190,7 +190,7 @@ HDC GLSurfaceWGL::GetDisplayDC() {
return g_display->device_context();
}
-NativeViewGLSurfaceWGL::NativeViewGLSurfaceWGL(gfx::PluginWindowHandle window)
+NativeViewGLSurfaceWGL::NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window)
: window_(window),
child_window_(NULL),
device_context_(NULL) {
diff --git a/ui/gfx/gl/gl_surface_wgl.h b/ui/gfx/gl/gl_surface_wgl.h
index 7a4ed69..4082a26 100644
--- a/ui/gfx/gl/gl_surface_wgl.h
+++ b/ui/gfx/gl/gl_surface_wgl.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -29,7 +29,7 @@ class GLSurfaceWGL : public GLSurface {
// A surface used to render to a view.
class NativeViewGLSurfaceWGL : public GLSurfaceWGL {
public:
- explicit NativeViewGLSurfaceWGL(gfx::PluginWindowHandle window);
+ explicit NativeViewGLSurfaceWGL(gfx::AcceleratedWidget window);
virtual ~NativeViewGLSurfaceWGL();
// Implement GLSurface.
@@ -41,8 +41,8 @@ class NativeViewGLSurfaceWGL : public GLSurfaceWGL {
virtual void* GetHandle();
private:
- gfx::PluginWindowHandle window_;
- gfx::PluginWindowHandle child_window_;
+ gfx::AcceleratedWidget window_;
+ gfx::AcceleratedWidget child_window_;
HDC device_context_;
DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceWGL);
diff --git a/ui/gfx/gl/gl_surface_win.cc b/ui/gfx/gl/gl_surface_win.cc
index 4df75a9..73f074d 100644
--- a/ui/gfx/gl/gl_surface_win.cc
+++ b/ui/gfx/gl/gl_surface_win.cc
@@ -20,7 +20,7 @@ namespace gfx {
// view.
class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
public:
- explicit NativeViewGLSurfaceOSMesa(gfx::PluginWindowHandle window);
+ explicit NativeViewGLSurfaceOSMesa(gfx::AcceleratedWidget window);
virtual ~NativeViewGLSurfaceOSMesa();
// Implement subset of GLSurface.
@@ -32,7 +32,7 @@ class NativeViewGLSurfaceOSMesa : public GLSurfaceOSMesa {
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
private:
- gfx::PluginWindowHandle window_;
+ gfx::AcceleratedWidget window_;
HDC device_context_;
DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceOSMesa);
@@ -59,7 +59,7 @@ bool GLSurface::InitializeOneOffInternal() {
}
NativeViewGLSurfaceOSMesa::NativeViewGLSurfaceOSMesa(
- gfx::PluginWindowHandle window)
+ gfx::AcceleratedWidget window)
: GLSurfaceOSMesa(OSMESA_RGBA, gfx::Size(1, 1)),
window_(window),
device_context_(NULL) {
@@ -173,7 +173,7 @@ bool NativeViewGLSurfaceOSMesa::PostSubBuffer(
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
- gfx::PluginWindowHandle window) {
+ gfx::AcceleratedWidget window) {
switch (GetGLImplementation()) {
case kGLImplementationOSMesaGL: {
scoped_refptr<GLSurface> surface(
diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h
index 77e3a65..bcb7c8f 100644
--- a/ui/gfx/native_widget_types.h
+++ b/ui/gfx/native_widget_types.h
@@ -61,7 +61,7 @@ struct CGContext;
class NSEvent;
class NSFont;
class NSImage;
-class NSView;
+struct NSView;
class NSWindow;
class NSTextField;
#endif // __OBJC__
@@ -260,14 +260,15 @@ const AcceleratedWidget kNullAcceleratedWidget = NULL;
#elif defined(USE_X11)
typedef unsigned long AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = 0;
-#elif defined(USE_AURA) && defined(OS_MACOSX)
-// Mac-Aura uses NSView-backed GLSurface. Regular Mac does not.
-// TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551.
+#elif defined(OS_MACOSX)
typedef NSView* AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = 0;
+#elif defined(OS_ANDROID)
+typedef uint64 PluginWindowHandle;
+const PluginWindowHandle kNullPluginWindow = 0;
+const PluginWindowHandle kDummyPluginWindow = 0xFEEDBEEF;
#else
-typedef void* AcceleratedWidget;
-const AcceleratedWidget kNullAcceleratedWidget = NULL;
+#error unknown platform
#endif
} // namespace gfx