| OLD | NEW |
| 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/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 26 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| 27 #include "gpu/command_buffer/common/trace_event.h" | 27 #include "gpu/command_buffer/common/trace_event.h" |
| 28 #include "ui/gfx/gpu_memory_buffer.h" | 28 #include "ui/gfx/gpu_memory_buffer.h" |
| 29 | 29 |
| 30 #if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) | 30 #if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS) |
| 31 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS | 31 #define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 #if defined(GPU_CLIENT_DEBUG) | 34 #if defined(GPU_CLIENT_DEBUG) |
| 35 #include "base/command_line.h" | 35 #include "base/command_line.h" |
| 36 #include "ui/gl/gl_switches.h" | 36 #include "gpu/command_buffer/client/gpu_switches.h" |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 namespace gpu { | 39 namespace gpu { |
| 40 namespace gles2 { | 40 namespace gles2 { |
| 41 | 41 |
| 42 // A 32-bit and 64-bit compatible way of converting a pointer to a GLuint. | 42 // A 32-bit and 64-bit compatible way of converting a pointer to a GLuint. |
| 43 static GLuint ToGLuint(const void* ptr) { | 43 static GLuint ToGLuint(const void* ptr) { |
| 44 return static_cast<GLuint>(reinterpret_cast<size_t>(ptr)); | 44 return static_cast<GLuint>(reinterpret_cast<size_t>(ptr)); |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 DCHECK(helper); | 123 DCHECK(helper); |
| 124 DCHECK(transfer_buffer); | 124 DCHECK(transfer_buffer); |
| 125 DCHECK(gpu_control); | 125 DCHECK(gpu_control); |
| 126 | 126 |
| 127 std::stringstream ss; | 127 std::stringstream ss; |
| 128 ss << std::hex << this; | 128 ss << std::hex << this; |
| 129 this_in_hex_ = ss.str(); | 129 this_in_hex_ = ss.str(); |
| 130 | 130 |
| 131 GPU_CLIENT_LOG_CODE_BLOCK({ | 131 GPU_CLIENT_LOG_CODE_BLOCK({ |
| 132 debug_ = CommandLine::ForCurrentProcess()->HasSwitch( | 132 debug_ = CommandLine::ForCurrentProcess()->HasSwitch( |
| 133 switches::kEnableGPUClientLogging); | 133 switches::kEnableGPUClientLoggingGPU); |
| 134 }); | 134 }); |
| 135 | 135 |
| 136 share_group_ = | 136 share_group_ = |
| 137 (share_group ? share_group : new ShareGroup(bind_generates_resource)); | 137 (share_group ? share_group : new ShareGroup(bind_generates_resource)); |
| 138 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); | 138 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); |
| 139 | 139 |
| 140 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); | 140 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool GLES2Implementation::Initialize( | 143 bool GLES2Implementation::Initialize( |
| (...skipping 4046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4190 return true; | 4190 return true; |
| 4191 } | 4191 } |
| 4192 | 4192 |
| 4193 // Include the auto-generated part of this file. We split this because it means | 4193 // Include the auto-generated part of this file. We split this because it means |
| 4194 // we can easily edit the non-auto generated parts right here in this file | 4194 // we can easily edit the non-auto generated parts right here in this file |
| 4195 // instead of having to edit some template or the code generator. | 4195 // instead of having to edit some template or the code generator. |
| 4196 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4196 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 4197 | 4197 |
| 4198 } // namespace gles2 | 4198 } // namespace gles2 |
| 4199 } // namespace gpu | 4199 } // namespace gpu |
| OLD | NEW |