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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1011 | 1011 |
1012 scoped_refptr<ContextProviderCommandBuffer> context_provider; | 1012 scoped_refptr<ContextProviderCommandBuffer> context_provider; |
1013 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; | 1013 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; |
1014 if (!use_software) { | 1014 if (!use_software) { |
1015 context_provider = ContextProviderCommandBuffer::Create( | 1015 context_provider = ContextProviderCommandBuffer::Create( |
1016 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); | 1016 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); |
1017 if (!context_provider.get()) { | 1017 if (!context_provider.get()) { |
1018 // Cause the compositor to wait and try again. | 1018 // Cause the compositor to wait and try again. |
1019 return nullptr; | 1019 return nullptr; |
1020 } | 1020 } |
1021 | 1021 worker_context_provider = |
1022 worker_context_provider = ContextProviderCommandBuffer::Create( | 1022 RenderThreadImpl::current()->SharedWorkerContextProvider(); |
1023 CreateGraphicsContext3D(false), RENDER_WORKER_CONTEXT); | 1023 if (!worker_context_provider) { |
1024 if (!worker_context_provider.get()) { | |
1025 // Cause the compositor to wait and try again. | 1024 // Cause the compositor to wait and try again. |
1026 return nullptr; | 1025 return nullptr; |
1027 } | 1026 } |
1028 } | 1027 } |
1029 | 1028 |
1030 uint32 output_surface_id = next_output_surface_id_++; | 1029 uint32 output_surface_id = next_output_surface_id_++; |
1031 // Composite-to-mailbox is currently used for layout tests in order to cause | 1030 // Composite-to-mailbox is currently used for layout tests in order to cause |
1032 // them to draw inside in the renderer to do the readback there. This should | 1031 // them to draw inside in the renderer to do the readback there. This should |
1033 // no longer be the case when crbug.com/311404 is fixed. | 1032 // no longer be the case when crbug.com/311404 is fixed. |
1034 if (!RenderThreadImpl::current() || | 1033 if (!RenderThreadImpl::current() || |
(...skipping 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2420 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2419 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2421 video_hole_frames_.AddObserver(frame); | 2420 video_hole_frames_.AddObserver(frame); |
2422 } | 2421 } |
2423 | 2422 |
2424 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2423 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2425 video_hole_frames_.RemoveObserver(frame); | 2424 video_hole_frames_.RemoveObserver(frame); |
2426 } | 2425 } |
2427 #endif // defined(VIDEO_HOLE) | 2426 #endif // defined(VIDEO_HOLE) |
2428 | 2427 |
2429 } // namespace content | 2428 } // namespace content |
OLD | NEW |