| 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 14 matching lines...) Expand all Loading... |
| 25 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
| 26 #include "content/public/common/content_switches.h" | 26 #include "content/public/common/content_switches.h" |
| 27 #include "content/renderer/gpu/compositor_output_surface.h" | 27 #include "content/renderer/gpu/compositor_output_surface.h" |
| 28 #include "content/renderer/gpu/compositor_software_output_device.h" | 28 #include "content/renderer/gpu/compositor_software_output_device.h" |
| 29 #include "content/renderer/gpu/delegated_compositor_output_surface.h" | 29 #include "content/renderer/gpu/delegated_compositor_output_surface.h" |
| 30 #include "content/renderer/gpu/input_handler_manager.h" | 30 #include "content/renderer/gpu/input_handler_manager.h" |
| 31 #include "content/renderer/gpu/mailbox_output_surface.h" | 31 #include "content/renderer/gpu/mailbox_output_surface.h" |
| 32 #include "content/renderer/gpu/render_widget_compositor.h" | 32 #include "content/renderer/gpu/render_widget_compositor.h" |
| 33 #include "content/renderer/ime_event_guard.h" | 33 #include "content/renderer/ime_event_guard.h" |
| 34 #include "content/renderer/render_process.h" | 34 #include "content/renderer/render_process.h" |
| 35 #include "content/renderer/render_process_visibility_manager.h" |
| 35 #include "content/renderer/render_thread_impl.h" | 36 #include "content/renderer/render_thread_impl.h" |
| 36 #include "content/renderer/renderer_webkitplatformsupport_impl.h" | 37 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 37 #include "ipc/ipc_sync_message.h" | 38 #include "ipc/ipc_sync_message.h" |
| 38 #include "skia/ext/platform_canvas.h" | 39 #include "skia/ext/platform_canvas.h" |
| 39 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 40 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 40 #include "third_party/WebKit/public/platform/WebPoint.h" | 41 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 41 #include "third_party/WebKit/public/platform/WebRect.h" | 42 #include "third_party/WebKit/public/platform/WebRect.h" |
| 42 #include "third_party/WebKit/public/platform/WebSize.h" | 43 #include "third_party/WebKit/public/platform/WebSize.h" |
| 43 #include "third_party/WebKit/public/platform/WebString.h" | 44 #include "third_party/WebKit/public/platform/WebString.h" |
| 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 RenderProcess::current()->AddRefProcess(); | 187 RenderProcess::current()->AddRefProcess(); |
| 187 DCHECK(RenderThread::Get()); | 188 DCHECK(RenderThread::Get()); |
| 188 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( | 189 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( |
| 189 switches::kDisableGpuVsync); | 190 switches::kDisableGpuVsync); |
| 190 is_threaded_compositing_enabled_ = | 191 is_threaded_compositing_enabled_ = |
| 191 CommandLine::ForCurrentProcess()->HasSwitch( | 192 CommandLine::ForCurrentProcess()->HasSwitch( |
| 192 switches::kEnableThreadedCompositing); | 193 switches::kEnableThreadedCompositing); |
| 193 overscroll_notifications_enabled_ = | 194 overscroll_notifications_enabled_ = |
| 194 CommandLine::ForCurrentProcess()->HasSwitch( | 195 CommandLine::ForCurrentProcess()->HasSwitch( |
| 195 switches::kEnableOverscrollNotifications); | 196 switches::kEnableOverscrollNotifications); |
| 197 |
| 198 RenderProcessVisibilityManager::GetInstance()->WidgetVisibilityChanged(true); |
| 196 } | 199 } |
| 197 | 200 |
| 198 RenderWidget::~RenderWidget() { | 201 RenderWidget::~RenderWidget() { |
| 199 DCHECK(!webwidget_) << "Leaking our WebWidget!"; | 202 DCHECK(!webwidget_) << "Leaking our WebWidget!"; |
| 200 STLDeleteElements(&updates_pending_swap_); | 203 STLDeleteElements(&updates_pending_swap_); |
| 201 if (current_paint_buf_) { | 204 if (current_paint_buf_) { |
| 202 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); | 205 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); |
| 203 current_paint_buf_ = NULL; | 206 current_paint_buf_ = NULL; |
| 204 } | 207 } |
| 205 // If we are swapped out, we have released already. | 208 // If we are swapped out, we have released already. |
| (...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2405 | 2408 |
| 2406 if (!context->InitializeWithDefaultBufferSizes( | 2409 if (!context->InitializeWithDefaultBufferSizes( |
| 2407 attributes, | 2410 attributes, |
| 2408 false /* bind generates resources */, | 2411 false /* bind generates resources */, |
| 2409 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2412 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
| 2410 return NULL; | 2413 return NULL; |
| 2411 return context.release(); | 2414 return context.release(); |
| 2412 } | 2415 } |
| 2413 | 2416 |
| 2414 } // namespace content | 2417 } // namespace content |
| OLD | NEW |