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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 MessageDeliveryPolicy policy) { | 1290 MessageDeliveryPolicy policy) { |
1291 // RenderThreadImpl::current() is NULL in some tests. | 1291 // RenderThreadImpl::current() is NULL in some tests. |
1292 if (!compositor_ || !RenderThreadImpl::current()) { | 1292 if (!compositor_ || !RenderThreadImpl::current()) { |
1293 Send(msg); | 1293 Send(msg); |
1294 return; | 1294 return; |
1295 } | 1295 } |
1296 | 1296 |
1297 scoped_ptr<cc::SwapPromise> swap_promise = | 1297 scoped_ptr<cc::SwapPromise> swap_promise = |
1298 QueueMessageImpl(msg, | 1298 QueueMessageImpl(msg, |
1299 policy, | 1299 policy, |
1300 frame_swap_message_queue_, | 1300 frame_swap_message_queue_.get(), |
1301 RenderThreadImpl::current()->sync_message_filter(), | 1301 RenderThreadImpl::current()->sync_message_filter(), |
1302 compositor_->commitRequested(), | 1302 compositor_->commitRequested(), |
1303 compositor_->GetSourceFrameNumber()); | 1303 compositor_->GetSourceFrameNumber()); |
1304 | 1304 |
1305 if (swap_promise) { | 1305 if (swap_promise) { |
1306 compositor_->QueueSwapPromise(swap_promise.Pass()); | 1306 compositor_->QueueSwapPromise(swap_promise.Pass()); |
1307 compositor_->SetNeedsCommit(); | 1307 compositor_->SetNeedsCommit(); |
1308 } | 1308 } |
1309 } | 1309 } |
1310 | 1310 |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2096 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2096 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
2097 if (CommandLine::ForCurrentProcess()->HasSwitch( | 2097 if (CommandLine::ForCurrentProcess()->HasSwitch( |
2098 switches::kDisableGpuCompositing)) | 2098 switches::kDisableGpuCompositing)) |
2099 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2099 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
2100 if (!RenderThreadImpl::current()) | 2100 if (!RenderThreadImpl::current()) |
2101 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2101 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
2102 CauseForGpuLaunch cause = | 2102 CauseForGpuLaunch cause = |
2103 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | 2103 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
2104 scoped_refptr<GpuChannelHost> gpu_channel_host( | 2104 scoped_refptr<GpuChannelHost> gpu_channel_host( |
2105 RenderThreadImpl::current()->EstablishGpuChannelSync(cause)); | 2105 RenderThreadImpl::current()->EstablishGpuChannelSync(cause)); |
2106 if (!gpu_channel_host) | 2106 if (!gpu_channel_host.get()) |
2107 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2107 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
2108 | 2108 |
2109 // Explicitly disable antialiasing for the compositor. As of the time of | 2109 // Explicitly disable antialiasing for the compositor. As of the time of |
2110 // this writing, the only platform that supported antialiasing for the | 2110 // this writing, the only platform that supported antialiasing for the |
2111 // compositor was Mac OS X, because the on-screen OpenGL context creation | 2111 // compositor was Mac OS X, because the on-screen OpenGL context creation |
2112 // code paths on Windows and Linux didn't yet have multisampling support. | 2112 // code paths on Windows and Linux didn't yet have multisampling support. |
2113 // Mac OS X essentially always behaves as though it's rendering offscreen. | 2113 // Mac OS X essentially always behaves as though it's rendering offscreen. |
2114 // Multisampling has a heavy cost especially on devices with relatively low | 2114 // Multisampling has a heavy cost especially on devices with relatively low |
2115 // fill rate like most notebooks, and the Mac implementation would need to | 2115 // fill rate like most notebooks, and the Mac implementation would need to |
2116 // be optimized to resolve directly into the IOSurface shared between the | 2116 // be optimized to resolve directly into the IOSurface shared between the |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2178 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2179 video_hole_frames_.AddObserver(frame); | 2179 video_hole_frames_.AddObserver(frame); |
2180 } | 2180 } |
2181 | 2181 |
2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2182 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2183 video_hole_frames_.RemoveObserver(frame); | 2183 video_hole_frames_.RemoveObserver(frame); |
2184 } | 2184 } |
2185 #endif // defined(VIDEO_HOLE) | 2185 #endif // defined(VIDEO_HOLE) |
2186 | 2186 |
2187 } // namespace content | 2187 } // namespace content |
OLD | NEW |