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

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

Issue 1095893002: gpu: Fix some context lost marking glitches+leaks and add UMA stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kbr's comment Created 5 years, 8 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') | gpu/BUILD.gn » ('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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 const base::CommandLine& command_line = 1004 const base::CommandLine& command_line =
1005 *base::CommandLine::ForCurrentProcess(); 1005 *base::CommandLine::ForCurrentProcess();
1006 bool use_software = fallback; 1006 bool use_software = fallback;
1007 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) 1007 if (command_line.HasSwitch(switches::kDisableGpuCompositing))
1008 use_software = true; 1008 use_software = true;
1009 1009
1010 scoped_refptr<ContextProviderCommandBuffer> context_provider; 1010 scoped_refptr<ContextProviderCommandBuffer> context_provider;
1011 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider; 1011 scoped_refptr<ContextProviderCommandBuffer> worker_context_provider;
1012 if (!use_software) { 1012 if (!use_software) {
1013 context_provider = ContextProviderCommandBuffer::Create( 1013 context_provider = ContextProviderCommandBuffer::Create(
1014 CreateGraphicsContext3D(), "RenderCompositor"); 1014 CreateGraphicsContext3D(), RENDER_COMPOSITOR_CONTEXT);
1015 if (!context_provider.get()) { 1015 if (!context_provider.get()) {
1016 // Cause the compositor to wait and try again. 1016 // Cause the compositor to wait and try again.
1017 return scoped_ptr<cc::OutputSurface>(); 1017 return scoped_ptr<cc::OutputSurface>();
1018 } 1018 }
1019 1019
1020 worker_context_provider = ContextProviderCommandBuffer::Create( 1020 worker_context_provider = ContextProviderCommandBuffer::Create(
1021 CreateGraphicsContext3D(), "RenderWorker"); 1021 CreateGraphicsContext3D(), RENDER_WORKER_CONTEXT);
1022 if (!worker_context_provider.get()) { 1022 if (!worker_context_provider.get()) {
1023 // Cause the compositor to wait and try again. 1023 // Cause the compositor to wait and try again.
1024 return scoped_ptr<cc::OutputSurface>(); 1024 return scoped_ptr<cc::OutputSurface>();
1025 } 1025 }
1026 } 1026 }
1027 1027
1028 uint32 output_surface_id = next_output_surface_id_++; 1028 uint32 output_surface_id = next_output_surface_id_++;
1029 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { 1029 if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) {
1030 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner()); 1030 DCHECK(compositor_deps_->GetCompositorImplThreadTaskRunner());
1031 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface( 1031 return scoped_ptr<cc::OutputSurface>(new DelegatedCompositorOutputSurface(
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2438 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2438 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2439 video_hole_frames_.AddObserver(frame); 2439 video_hole_frames_.AddObserver(frame);
2440 } 2440 }
2441 2441
2442 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2442 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2443 video_hole_frames_.RemoveObserver(frame); 2443 video_hole_frames_.RemoveObserver(frame);
2444 } 2444 }
2445 #endif // defined(VIDEO_HOLE) 2445 #endif // defined(VIDEO_HOLE)
2446 2446
2447 } // namespace content 2447 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_thread_impl.cc ('k') | gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698