| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // If we are swapping in, we call AddRefProcess to prevent the process from | 288 // If we are swapping in, we call AddRefProcess to prevent the process from |
| 289 // exiting. | 289 // exiting. |
| 290 if (!is_swapped_out) | 290 if (!is_swapped_out) |
| 291 RenderProcess::current()->AddRefProcess(); | 291 RenderProcess::current()->AddRefProcess(); |
| 292 } | 292 } |
| 293 | 293 |
| 294 bool RenderWidget::AllowPartialSwap() const { | 294 bool RenderWidget::AllowPartialSwap() const { |
| 295 return true; | 295 return true; |
| 296 } | 296 } |
| 297 | 297 |
| 298 bool RenderWidget::EnableSynchronousCompositing() const { |
| 299 #if defined(OS_ANDROID) |
| 300 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 301 switches::kEnableSynchronousRendererCompositor)) { |
| 302 return true; |
| 303 } |
| 304 #endif |
| 305 return false; |
| 306 } |
| 307 |
| 298 bool RenderWidget::OnMessageReceived(const IPC::Message& message) { | 308 bool RenderWidget::OnMessageReceived(const IPC::Message& message) { |
| 299 bool handled = true; | 309 bool handled = true; |
| 300 IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) | 310 IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) |
| 301 IPC_MESSAGE_HANDLER(InputMsg_HandleInputEvent, OnHandleInputEvent) | 311 IPC_MESSAGE_HANDLER(InputMsg_HandleInputEvent, OnHandleInputEvent) |
| 302 IPC_MESSAGE_HANDLER(InputMsg_MouseCaptureLost, OnMouseCaptureLost) | 312 IPC_MESSAGE_HANDLER(InputMsg_MouseCaptureLost, OnMouseCaptureLost) |
| 303 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetFocus) | 313 IPC_MESSAGE_HANDLER(InputMsg_SetFocus, OnSetFocus) |
| 304 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) | 314 IPC_MESSAGE_HANDLER(ViewMsg_Close, OnClose) |
| 305 IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck) | 315 IPC_MESSAGE_HANDLER(ViewMsg_CreatingNew_ACK, OnCreatingNewAck) |
| 306 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) | 316 IPC_MESSAGE_HANDLER(ViewMsg_Resize, OnResize) |
| 307 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) | 317 IPC_MESSAGE_HANDLER(ViewMsg_ChangeResizeRect, OnChangeResizeRect) |
| (...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2323 | 2333 |
| 2324 if (!context->Initialize( | 2334 if (!context->Initialize( |
| 2325 attributes, | 2335 attributes, |
| 2326 false /* bind generates resources */, | 2336 false /* bind generates resources */, |
| 2327 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2337 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
| 2328 return NULL; | 2338 return NULL; |
| 2329 return context.release(); | 2339 return context.release(); |
| 2330 } | 2340 } |
| 2331 | 2341 |
| 2332 } // namespace content | 2342 } // namespace content |
| OLD | NEW |