Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: content/renderer/render_widget.cc

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | ui/compositor/test/in_process_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698