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

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

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: surfaces_context_provider fix Created 5 years, 3 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
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 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 1012
1013 scoped_refptr<ContextProviderCommandBuffer> context_provider; 1013 scoped_refptr<ContextProviderCommandBuffer> context_provider;
1014 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; 1014 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider;
1015 if (!use_software) { 1015 if (!use_software) {
1016 context_provider = ContextProviderCommandBuffer::Create( 1016 context_provider = ContextProviderCommandBuffer::Create(
1017 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT); 1017 CreateGraphicsContext3D(true), RENDER_COMPOSITOR_CONTEXT);
1018 if (!context_provider.get()) { 1018 if (!context_provider.get()) {
1019 // Cause the compositor to wait and try again. 1019 // Cause the compositor to wait and try again.
1020 return scoped_ptr<cc::OutputSurface>(); 1020 return scoped_ptr<cc::OutputSurface>();
1021 } 1021 }
1022 1022 worker_context_provider =
1023 worker_context_provider = ContextProviderCommandBuffer::Create( 1023 RenderThreadImpl::current()->SharedWorkerContextProvider();
1024 CreateGraphicsContext3D(false), RENDER_WORKER_CONTEXT); 1024 if (!worker_context_provider) {
1025 if (!worker_context_provider.get()) {
1026 // Cause the compositor to wait and try again. 1025 // Cause the compositor to wait and try again.
1027 return scoped_ptr<cc::OutputSurface>(); 1026 return scoped_ptr<cc::OutputSurface>();
1028 } 1027 }
1029 } 1028 }
1030 1029
1031 uint32 output_surface_id = next_output_surface_id_++; 1030 uint32 output_surface_id = next_output_surface_id_++;
1032 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { 1031 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) {
1033 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); 1032 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner());
1034 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( 1033 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface(
1035 routing_id(), output_surface_id, context_provider, 1034 routing_id(), output_surface_id, context_provider,
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
2458 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2457 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2459 video_hole_frames_.AddObserver(frame); 2458 video_hole_frames_.AddObserver(frame);
2460 } 2459 }
2461 2460
2462 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2461 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2463 video_hole_frames_.RemoveObserver(frame); 2462 video_hole_frames_.RemoveObserver(frame);
2464 } 2463 }
2465 #endif // defined(VIDEO_HOLE) 2464 #endif // defined(VIDEO_HOLE)
2466 2465
2467 } // namespace content 2466 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698