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/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 #include "content/renderer/android/synchronous_compositor_filter.h" | 87 #include "content/renderer/android/synchronous_compositor_filter.h" |
88 #include "content/renderer/android/synchronous_compositor_output_surface.h" | 88 #include "content/renderer/android/synchronous_compositor_output_surface.h" |
89 #endif | 89 #endif |
90 | 90 |
91 #if defined(OS_POSIX) | 91 #if defined(OS_POSIX) |
92 #include "ipc/ipc_channel_posix.h" | 92 #include "ipc/ipc_channel_posix.h" |
93 #include "third_party/skia/include/core/SkMallocPixelRef.h" | 93 #include "third_party/skia/include/core/SkMallocPixelRef.h" |
94 #include "third_party/skia/include/core/SkPixelRef.h" | 94 #include "third_party/skia/include/core/SkPixelRef.h" |
95 #endif // defined(OS_POSIX) | 95 #endif // defined(OS_POSIX) |
96 | 96 |
97 #if defined(MOJO_SHELL_CLIENT) | |
98 #include "content/public/common/mojo_shell_connection.h" | |
99 #include "content/renderer/render_widget_mus_connection.h" | |
100 #endif | |
101 | |
97 #include "third_party/WebKit/public/web/WebWidget.h" | 102 #include "third_party/WebKit/public/web/WebWidget.h" |
98 | 103 |
99 using blink::WebCompositionUnderline; | 104 using blink::WebCompositionUnderline; |
100 using blink::WebCursorInfo; | 105 using blink::WebCursorInfo; |
101 using blink::WebDeviceEmulationParams; | 106 using blink::WebDeviceEmulationParams; |
102 using blink::WebGestureEvent; | 107 using blink::WebGestureEvent; |
103 using blink::WebInputEvent; | 108 using blink::WebInputEvent; |
104 using blink::WebKeyboardEvent; | 109 using blink::WebKeyboardEvent; |
105 using blink::WebMouseEvent; | 110 using blink::WebMouseEvent; |
106 using blink::WebMouseWheelEvent; | 111 using blink::WebMouseWheelEvent; |
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1006 // For widgets that are never visible, we don't start the compositor, so we | 1011 // For widgets that are never visible, we don't start the compositor, so we |
1007 // never get a request for a cc::OutputSurface. | 1012 // never get a request for a cc::OutputSurface. |
1008 DCHECK(!compositor_never_visible_); | 1013 DCHECK(!compositor_never_visible_); |
1009 | 1014 |
1010 const base::CommandLine& command_line = | 1015 const base::CommandLine& command_line = |
1011 *base::CommandLine::ForCurrentProcess(); | 1016 *base::CommandLine::ForCurrentProcess(); |
1012 bool use_software = fallback; | 1017 bool use_software = fallback; |
1013 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1018 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
1014 use_software = true; | 1019 use_software = true; |
1015 | 1020 |
1021 #if defined(MOJO_SHELL_CLIENT) | |
1022 if (MojoShellConnection::Get()->GetApplication() && !use_software) { | |
Ben Goodger (Google)
2015/12/01 22:46:57
you should null check Get() before dereferencing.
| |
1023 RenderWidgetMusConnection* connection = | |
1024 RenderWidgetMusConnection::GetOrCreate(routing_id()); | |
1025 return connection->CreateOutputSurface(); | |
1026 } | |
1027 #endif | |
1028 | |
1016 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 1029 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
1017 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; | 1030 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; |
1018 if (!use_software) { | 1031 if (!use_software) { |
1019 context_provider = ContextProviderCommandBuffer::Create( | 1032 context_provider = ContextProviderCommandBuffer::Create( |
1020 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); | 1033 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); |
1021 if (!context_provider.get()) { | 1034 if (!context_provider.get()) { |
1022 // Cause the compositor to wait and try again. | 1035 // Cause the compositor to wait and try again. |
1023 return nullptr; | 1036 return nullptr; |
1024 } | 1037 } |
1025 worker_context_provider = | 1038 worker_context_provider = |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2451 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2464 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2452 video_hole_frames_.AddObserver(frame); | 2465 video_hole_frames_.AddObserver(frame); |
2453 } | 2466 } |
2454 | 2467 |
2455 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2468 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2456 video_hole_frames_.RemoveObserver(frame); | 2469 video_hole_frames_.RemoveObserver(frame); |
2457 } | 2470 } |
2458 #endif // defined(VIDEO_HOLE) | 2471 #endif // defined(VIDEO_HOLE) |
2459 | 2472 |
2460 } // namespace content | 2473 } // namespace content |
OLD | NEW |