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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_factory_impl.cc

Issue 199443004: gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checkmem: benchmark Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/compositor/gpu_process_transport_factory.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/android/in_process/synchronous_compositor_factory_impl .h" 5 #include "content/browser/android/in_process/synchronous_compositor_factory_impl .h"
6 6
7 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h" 7 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "gpu/command_buffer/client/gl_in_process_context.h" 9 #include "gpu/command_buffer/client/gl_in_process_context.h"
10 #include "ui/gl/android/surface_texture.h" 10 #include "ui/gl/android/surface_texture.h"
(...skipping 26 matching lines...) Expand all
37 scoped_refptr<gpu::InProcessCommandBuffer::Service> service, 37 scoped_refptr<gpu::InProcessCommandBuffer::Service> service,
38 gpu::GLInProcessContext* share_context) { 38 gpu::GLInProcessContext* share_context) {
39 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; 39 const gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
40 40
41 if (!surface) 41 if (!surface)
42 surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); 42 surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
43 43
44 gpu::GLInProcessContextAttribs in_process_attribs; 44 gpu::GLInProcessContextAttribs in_process_attribs;
45 WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes( 45 WebGraphicsContext3DInProcessCommandBufferImpl::ConvertAttributes(
46 GetDefaultAttribs(), &in_process_attribs); 46 GetDefaultAttribs(), &in_process_attribs);
47 in_process_attribs.lose_context_when_out_of_memory = 1;
47 scoped_ptr<gpu::GLInProcessContext> context( 48 scoped_ptr<gpu::GLInProcessContext> context(
48 gpu::GLInProcessContext::CreateWithSurface(surface, 49 gpu::GLInProcessContext::CreateWithSurface(
49 service, 50 surface, service, share_context, in_process_attribs, gpu_preference));
50 share_context,
51 in_process_attribs,
52 gpu_preference));
53 return context.Pass(); 51 return context.Pass();
54 } 52 }
55 53
56 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext( 54 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> WrapContext(
57 scoped_ptr<gpu::GLInProcessContext> context) { 55 scoped_ptr<gpu::GLInProcessContext> context) {
58 if (!context.get()) 56 if (!context.get())
59 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(); 57 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>();
60 58
61 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>( 59 return scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>(
62 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( 60 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return video_context_provider_; 233 return video_context_provider_;
236 } 234 }
237 235
238 void SynchronousCompositorFactoryImpl::SetDeferredGpuService( 236 void SynchronousCompositorFactoryImpl::SetDeferredGpuService(
239 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { 237 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) {
240 DCHECK(!service_); 238 DCHECK(!service_);
241 service_ = service; 239 service_ = service;
242 } 240 }
243 241
244 } // namespace content 242 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/gpu_process_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698