Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: chrome/renderer/ggl/ggl.cc

Issue 3067026: Initial port of accelerated compositor to Mac OS X 10.6. Reused... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/ggl/ggl.h ('k') | chrome/renderer/gpu_channel_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/ggl/ggl.cc
===================================================================
--- chrome/renderer/ggl/ggl.cc (revision 54820)
+++ chrome/renderer/ggl/ggl.cc (working copy)
@@ -59,8 +59,15 @@
// Initialize a GGL context that can be used in association with a a GPU
// channel acquired from a RenderWidget or RenderView.
- bool Initialize(gfx::NativeViewId view, const gfx::Size& size);
+ bool Initialize(gfx::NativeViewId view,
+ int render_view_id,
+ const gfx::Size& size);
+#if defined(OS_MACOSX)
+ // Asynchronously resizes an onscreen frame buffer.
+ void ResizeOnscreen(const gfx::Size& size);
+#endif
+
// Asynchronously resizes an offscreen frame buffer.
void ResizeOffscreen(const gfx::Size& size);
@@ -114,7 +121,9 @@
Destroy();
}
-bool Context::Initialize(gfx::NativeViewId view, const gfx::Size& size) {
+bool Context::Initialize(gfx::NativeViewId view,
+ int render_view_id,
+ const gfx::Size& size) {
DCHECK(size.width() >= 0 && size.height() >= 0);
if (channel_->state() != GpuChannelHost::CONNECTED)
@@ -134,7 +143,8 @@
// Create a proxy to a command buffer in the GPU process.
if (view) {
- command_buffer_ = channel_->CreateViewCommandBuffer(view);
+ command_buffer_ =
+ channel_->CreateViewCommandBuffer(view, render_view_id);
} else {
CommandBufferProxy* parent_command_buffer =
parent_.get() ? parent_->command_buffer_ : NULL;
@@ -189,6 +199,13 @@
return true;
}
+#if defined(OS_MACOSX)
+void Context::ResizeOnscreen(const gfx::Size& size) {
+ DCHECK(size.width() > 0 && size.height() > 0);
+ command_buffer_->SetWindowSize(size);
+}
+#endif
+
void Context::ResizeOffscreen(const gfx::Size& size) {
DCHECK(size.width() > 0 && size.height() > 0);
command_buffer_->ResizeOffscreenFrameBuffer(size);
@@ -264,10 +281,12 @@
#endif // ENABLE_GPU
-Context* CreateViewContext(GpuChannelHost* channel, gfx::NativeViewId view) {
+Context* CreateViewContext(GpuChannelHost* channel,
+ gfx::NativeViewId view,
+ int render_view_id) {
#if defined(ENABLE_GPU)
scoped_ptr<Context> context(new Context(channel, NULL));
- if (!context->Initialize(view, gfx::Size()))
+ if (!context->Initialize(view, render_view_id, gfx::Size()))
return NULL;
return context.release();
@@ -276,12 +295,20 @@
#endif
}
+#if defined(OS_MACOSX)
+void ResizeOnscreenContext(Context* context, const gfx::Size& size) {
+#if defined(ENABLE_GPU)
+ context->ResizeOnscreen(size);
+#endif
+}
+#endif
+
Context* CreateOffscreenContext(GpuChannelHost* channel,
Context* parent,
const gfx::Size& size) {
#if defined(ENABLE_GPU)
scoped_ptr<Context> context(new Context(channel, parent));
- if (!context->Initialize(0, size))
+ if (!context->Initialize(0, 0, size))
return NULL;
return context.release();
« no previous file with comments | « chrome/renderer/ggl/ggl.h ('k') | chrome/renderer/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698