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

Side by Side Diff: chrome/gpu/gpu_command_buffer_stub.cc

Issue 5105006: Resize synchronization for Linux. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make -j17 all is my friend (fix the test build). Created 10 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/gpu/gpu_command_buffer_stub.h ('k') | gfx/gtk_preserve_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/child_thread.h" 10 #include "chrome/common/child_thread.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 #if defined(OS_MACOSX) 106 #if defined(OS_MACOSX)
107 if (handle_) { 107 if (handle_) {
108 // This context conceptually puts its output directly on the 108 // This context conceptually puts its output directly on the
109 // screen, rendered by the accelerated plugin layer in 109 // screen, rendered by the accelerated plugin layer in
110 // RenderWidgetHostViewMac. Set up a pathway to notify the 110 // RenderWidgetHostViewMac. Set up a pathway to notify the
111 // browser process when its contents change. 111 // browser process when its contents change.
112 processor_->SetSwapBuffersCallback( 112 processor_->SetSwapBuffersCallback(
113 NewCallback(this, 113 NewCallback(this,
114 &GpuCommandBufferStub::SwapBuffersCallback)); 114 &GpuCommandBufferStub::SwapBuffersCallback));
115 } 115 }
116 #elif defined(OS_LINUX)
117 if (handle_) {
118 // Set up a pathway to allow the Gpu process to ask the browser
119 // for a window resize.
120 processor_->SetResizeCallback(
121 NewCallback(this,
122 &GpuCommandBufferStub::ResizeCallback));
123 }
116 #endif 124 #endif
117 } else { 125 } else {
118 processor_.reset(); 126 processor_.reset();
119 command_buffer_.reset(); 127 command_buffer_.reset();
120 } 128 }
121 } 129 }
122 } 130 }
123 } 131 }
124 132
125 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) { 133 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 204 }
197 } 205 }
198 206
199 void GpuCommandBufferStub::SwapBuffersCallback() { 207 void GpuCommandBufferStub::SwapBuffersCallback() {
200 ChildThread* gpu_thread = ChildThread::current(); 208 ChildThread* gpu_thread = ChildThread::current();
201 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped( 209 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(
202 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId())); 210 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId()));
203 } 211 }
204 #endif // defined(OS_MACOSX) 212 #endif // defined(OS_MACOSX)
205 213
214 #if defined(OS_LINUX)
215 void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
216 ChildThread* gpu_thread = ChildThread::current();
217 bool result = false;
218 gpu_thread->Send(
219 new GpuHostMsg_ResizeXID(handle_, size, &result));
220 }
221 #endif // defined(OS_LINUX)
222
206 #endif // ENABLE_GPU 223 #endif // ENABLE_GPU
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_command_buffer_stub.h ('k') | gfx/gtk_preserve_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698