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

Side by Side Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1900993002: Move SharedMemoryLimits out of WebGraphicsContext3DCommandBufferImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@limits
Patch Set: move-limits: types Created 4 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
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 // A class to emulate GLES2 over command buffers. 5 // A class to emulate GLES2 over command buffers.
6 6
7 #include "gpu/command_buffer/client/gles2_implementation.h" 7 #include "gpu/command_buffer/client/gles2_implementation.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #include <GLES2/gl2ext.h> 10 #include <GLES2/gl2ext.h>
(...skipping 14 matching lines...) Expand all
25 #include "base/thread_task_runner_handle.h" 25 #include "base/thread_task_runner_handle.h"
26 #include "base/trace_event/memory_allocator_dump.h" 26 #include "base/trace_event/memory_allocator_dump.h"
27 #include "base/trace_event/memory_dump_manager.h" 27 #include "base/trace_event/memory_dump_manager.h"
28 #include "base/trace_event/process_memory_dump.h" 28 #include "base/trace_event/process_memory_dump.h"
29 #include "base/trace_event/trace_event.h" 29 #include "base/trace_event/trace_event.h"
30 #include "gpu/command_buffer/client/buffer_tracker.h" 30 #include "gpu/command_buffer/client/buffer_tracker.h"
31 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 31 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
32 #include "gpu/command_buffer/client/gpu_control.h" 32 #include "gpu/command_buffer/client/gpu_control.h"
33 #include "gpu/command_buffer/client/program_info_manager.h" 33 #include "gpu/command_buffer/client/program_info_manager.h"
34 #include "gpu/command_buffer/client/query_tracker.h" 34 #include "gpu/command_buffer/client/query_tracker.h"
35 #include "gpu/command_buffer/client/shared_memory_limits.h"
35 #include "gpu/command_buffer/client/transfer_buffer.h" 36 #include "gpu/command_buffer/client/transfer_buffer.h"
36 #include "gpu/command_buffer/client/vertex_array_object_manager.h" 37 #include "gpu/command_buffer/client/vertex_array_object_manager.h"
37 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 38 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
38 #include "gpu/command_buffer/common/id_allocator.h" 39 #include "gpu/command_buffer/common/id_allocator.h"
39 #include "gpu/command_buffer/common/sync_token.h" 40 #include "gpu/command_buffer/common/sync_token.h"
40 #include "ui/gfx/geometry/rect.h" 41 #include "ui/gfx/geometry/rect.h"
41 #include "ui/gfx/geometry/rect_f.h" 42 #include "ui/gfx/geometry/rect_f.h"
42 43
43 #if defined(GPU_CLIENT_DEBUG) 44 #if defined(GPU_CLIENT_DEBUG)
44 #include "base/command_line.h" 45 #include "base/command_line.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 min_transfer_buffer_size, 209 min_transfer_buffer_size,
209 max_transfer_buffer_size, 210 max_transfer_buffer_size,
210 kAlignment, 211 kAlignment,
211 kSizeToFlush)) { 212 kSizeToFlush)) {
212 return false; 213 return false;
213 } 214 }
214 215
215 mapped_memory_.reset(new MappedMemoryManager(helper_, mapped_memory_limit)); 216 mapped_memory_.reset(new MappedMemoryManager(helper_, mapped_memory_limit));
216 217
217 unsigned chunk_size = 2 * 1024 * 1024; 218 unsigned chunk_size = 2 * 1024 * 1024;
218 if (mapped_memory_limit != kNoLimit) { 219 if (mapped_memory_limit != SharedMemoryLimits::kNoLimit) {
219 // Use smaller chunks if the client is very memory conscientious. 220 // Use smaller chunks if the client is very memory conscientious.
220 chunk_size = std::min(mapped_memory_limit / 4, chunk_size); 221 chunk_size = std::min(mapped_memory_limit / 4, chunk_size);
221 } 222 }
222 mapped_memory_->set_chunk_size_multiple(chunk_size); 223 mapped_memory_->set_chunk_size_multiple(chunk_size);
223 224
224 GLStaticState::ShaderPrecisionMap* shader_precisions = 225 GLStaticState::ShaderPrecisionMap* shader_precisions =
225 &static_state_.shader_precisions; 226 &static_state_.shader_precisions;
226 capabilities_.VisitPrecisions([shader_precisions]( 227 capabilities_.VisitPrecisions([shader_precisions](
227 GLenum shader, GLenum type, Capabilities::ShaderPrecision* result) { 228 GLenum shader, GLenum type, Capabilities::ShaderPrecision* result) {
228 const GLStaticState::ShaderPrecisionKey key(shader, type); 229 const GLStaticState::ShaderPrecisionKey key(shader, type);
(...skipping 6649 matching lines...) Expand 10 before | Expand all | Expand 10 after
6878 cached_extensions_.clear(); 6879 cached_extensions_.clear();
6879 } 6880 }
6880 6881
6881 // Include the auto-generated part of this file. We split this because it means 6882 // Include the auto-generated part of this file. We split this because it means
6882 // we can easily edit the non-auto generated parts right here in this file 6883 // we can easily edit the non-auto generated parts right here in this file
6883 // instead of having to edit some template or the code generator. 6884 // instead of having to edit some template or the code generator.
6884 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 6885 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
6885 6886
6886 } // namespace gles2 6887 } // namespace gles2
6887 } // namespace gpu 6888 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698