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

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h

Issue 221783002: Revert of gpu: Raise GL_OUT_OF_MEMORY when BeginQueryEXT fails to allocate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 DISALLOW_COPY_AND_ASSIGN(ShareGroup); 118 DISALLOW_COPY_AND_ASSIGN(ShareGroup);
119 }; 119 };
120 120
121 WebGraphicsContext3DCommandBufferImpl( 121 WebGraphicsContext3DCommandBufferImpl(
122 int surface_id, 122 int surface_id,
123 const GURL& active_url, 123 const GURL& active_url,
124 GpuChannelHost* host, 124 GpuChannelHost* host,
125 const Attributes& attributes, 125 const Attributes& attributes,
126 bool bind_generates_resources, 126 bool bind_generates_resources,
127 bool lose_context_when_out_of_memory,
128 const SharedMemoryLimits& limits, 127 const SharedMemoryLimits& limits,
129 WebGraphicsContext3DCommandBufferImpl* share_context); 128 WebGraphicsContext3DCommandBufferImpl* share_context);
130 129
131 virtual ~WebGraphicsContext3DCommandBufferImpl(); 130 virtual ~WebGraphicsContext3DCommandBufferImpl();
132 131
133 CommandBufferProxyImpl* GetCommandBufferProxy() { 132 CommandBufferProxyImpl* GetCommandBufferProxy() {
134 return command_buffer_.get(); 133 return command_buffer_.get();
135 } 134 }
136 135
137 CONTENT_EXPORT gpu::ContextSupport* GetContextSupport(); 136 CONTENT_EXPORT gpu::ContextSupport* GetContextSupport();
138 137
139 gpu::gles2::GLES2Implementation* GetImplementation() { 138 gpu::gles2::GLES2Implementation* GetImplementation() {
140 return real_gl_.get(); 139 return real_gl_.get();
141 } 140 }
142 141
143 // Return true if GPU process reported context lost or there was a 142 // Return true if GPU process reported context lost or there was a
144 // problem communicating with the GPU process. 143 // problem communicating with the GPU process.
145 bool IsCommandBufferContextLost(); 144 bool IsCommandBufferContextLost();
146 145
147 // Create & initialize a WebGraphicsContext3DCommandBufferImpl. Return NULL 146 // Create & initialize a WebGraphicsContext3DCommandBufferImpl. Return NULL
148 // on any failure. 147 // on any failure.
149 static CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl* 148 static CONTENT_EXPORT WebGraphicsContext3DCommandBufferImpl*
150 CreateOffscreenContext( 149 CreateOffscreenContext(
151 GpuChannelHost* host, 150 GpuChannelHost* host,
152 const WebGraphicsContext3D::Attributes& attributes, 151 const WebGraphicsContext3D::Attributes& attributes,
153 bool lose_context_when_out_of_memory,
154 const GURL& active_url, 152 const GURL& active_url,
155 const SharedMemoryLimits& limits, 153 const SharedMemoryLimits& limits,
156 WebGraphicsContext3DCommandBufferImpl* share_context); 154 WebGraphicsContext3DCommandBufferImpl* share_context);
157 155
158 size_t GetMappedMemoryLimit() { 156 size_t GetMappedMemoryLimit() {
159 return mem_limits_.mapped_memory_reclaim_limit; 157 return mem_limits_.mapped_memory_reclaim_limit;
160 } 158 }
161 159
162 //---------------------------------------------------------------------- 160 //----------------------------------------------------------------------
163 // WebGraphicsContext3D methods 161 // WebGraphicsContext3D methods
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 CONTEXT_LOST = 0x300E 680 CONTEXT_LOST = 0x300E
683 }; 681 };
684 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in 682 // WebGraphicsContext3DCommandBufferImpl configuration attributes. Those in
685 // the 16-bit range are the same as used by EGL. Those outside the 16-bit 683 // the 16-bit range are the same as used by EGL. Those outside the 16-bit
686 // range are unique to Chromium. Attributes are matched using a closest fit 684 // range are unique to Chromium. Attributes are matched using a closest fit
687 // algorithm. 685 // algorithm.
688 // Changes to this enum should also be copied to 686 // Changes to this enum should also be copied to
689 // gpu/command_buffer/common/gles2_cmd_utils.cc and to 687 // gpu/command_buffer/common/gles2_cmd_utils.cc and to
690 // gpu/command_buffer/client/gl_in_process_context.cc 688 // gpu/command_buffer/client/gl_in_process_context.cc
691 enum Attribute { 689 enum Attribute {
692 ALPHA_SIZE = 0x3021, 690 ALPHA_SIZE = 0x3021,
693 BLUE_SIZE = 0x3022, 691 BLUE_SIZE = 0x3022,
694 GREEN_SIZE = 0x3023, 692 GREEN_SIZE = 0x3023,
695 RED_SIZE = 0x3024, 693 RED_SIZE = 0x3024,
696 DEPTH_SIZE = 0x3025, 694 DEPTH_SIZE = 0x3025,
697 STENCIL_SIZE = 0x3026, 695 STENCIL_SIZE = 0x3026,
698 SAMPLES = 0x3031, 696 SAMPLES = 0x3031,
699 SAMPLE_BUFFERS = 0x3032, 697 SAMPLE_BUFFERS = 0x3032,
700 HEIGHT = 0x3056, 698 HEIGHT = 0x3056,
701 WIDTH = 0x3057, 699 WIDTH = 0x3057,
702 NONE = 0x3038, // Attrib list = terminator 700 NONE = 0x3038, // Attrib list = terminator
703 SHARE_RESOURCES = 0x10000, 701 SHARE_RESOURCES = 0x10000,
704 BIND_GENERATES_RESOURCES = 0x10001, 702 BIND_GENERATES_RESOURCES = 0x10001,
705 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002, 703 FAIL_IF_MAJOR_PERF_CAVEAT = 0x10002
706 LOSE_CONTEXT_WHEN_OUT_OF_MEMORY = 0x10003,
707 }; 704 };
708 friend class WebGraphicsContext3DErrorMessageCallback; 705 friend class WebGraphicsContext3DErrorMessageCallback;
709 706
710 // Initialize the underlying GL context. May be called multiple times; second 707 // Initialize the underlying GL context. May be called multiple times; second
711 // and subsequent calls are ignored. Must be called from the thread that is 708 // and subsequent calls are ignored. Must be called from the thread that is
712 // going to use this object to issue GL commands (which might not be the main 709 // going to use this object to issue GL commands (which might not be the main
713 // thread). 710 // thread).
714 bool MaybeInitializeGL(); 711 bool MaybeInitializeGL();
715 712
716 bool InitializeCommandBuffer(bool onscreen, 713 bool InitializeCommandBuffer(bool onscreen,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 760
764 bool initialized_; 761 bool initialized_;
765 scoped_ptr<CommandBufferProxyImpl> command_buffer_; 762 scoped_ptr<CommandBufferProxyImpl> command_buffer_;
766 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; 763 scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_;
767 scoped_ptr<gpu::TransferBuffer> transfer_buffer_; 764 scoped_ptr<gpu::TransferBuffer> transfer_buffer_;
768 gpu::gles2::GLES2Interface* gl_; 765 gpu::gles2::GLES2Interface* gl_;
769 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_; 766 scoped_ptr<gpu::gles2::GLES2Implementation> real_gl_;
770 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_; 767 scoped_ptr<gpu::gles2::GLES2Interface> trace_gl_;
771 Error last_error_; 768 Error last_error_;
772 bool bind_generates_resources_; 769 bool bind_generates_resources_;
773 bool lose_context_when_out_of_memory_;
774 SharedMemoryLimits mem_limits_; 770 SharedMemoryLimits mem_limits_;
775 771
776 uint32_t flush_id_; 772 uint32_t flush_id_;
777 scoped_refptr<ShareGroup> share_group_; 773 scoped_refptr<ShareGroup> share_group_;
778 }; 774 };
779 775
780 } // namespace content 776 } // namespace content
781 777
782 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ 778 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698