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

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

Issue 1548443002: Introducing gpu::CommandBufferId as a distinct, IdType<...>-based type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-save-package-id-self-contained
Patch Set: Rebasing... Created 4 years, 10 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 ss << std::hex << this; 140 ss << std::hex << this;
141 this_in_hex_ = ss.str(); 141 this_in_hex_ = ss.str();
142 142
143 GPU_CLIENT_LOG_CODE_BLOCK({ 143 GPU_CLIENT_LOG_CODE_BLOCK({
144 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch( 144 debug_ = base::CommandLine::ForCurrentProcess()->HasSwitch(
145 switches::kEnableGPUClientLogging); 145 switches::kEnableGPUClientLogging);
146 }); 146 });
147 147
148 share_group_ = 148 share_group_ =
149 (share_group ? share_group 149 (share_group ? share_group
150 : new ShareGroup(bind_generates_resource, 150 : new ShareGroup(
151 gpu_control_->GetCommandBufferID())); 151 bind_generates_resource,
152 gpu_control_->GetCommandBufferID().GetUnsafeValue()));
152 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource); 153 DCHECK(share_group_->bind_generates_resource() == bind_generates_resource);
153 154
154 memset(&reserved_ids_, 0, sizeof(reserved_ids_)); 155 memset(&reserved_ids_, 0, sizeof(reserved_ids_));
155 } 156 }
156 157
157 bool GLES2Implementation::Initialize( 158 bool GLES2Implementation::Initialize(
158 unsigned int starting_transfer_buffer_size, 159 unsigned int starting_transfer_buffer_size,
159 unsigned int min_transfer_buffer_size, 160 unsigned int min_transfer_buffer_size,
160 unsigned int max_transfer_buffer_size, 161 unsigned int max_transfer_buffer_size,
161 unsigned int mapped_memory_limit) { 162 unsigned int mapped_memory_limit) {
(...skipping 5481 matching lines...) Expand 10 before | Expand all | Expand 10 after
5643 if (sync_token_data.HasData()) { 5644 if (sync_token_data.HasData()) {
5644 if (!sync_token_data.verified_flush() && 5645 if (!sync_token_data.verified_flush() &&
5645 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) { 5646 !gpu_control_->CanWaitUnverifiedSyncToken(&sync_token_data)) {
5646 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", 5647 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM",
5647 "Cannot wait on sync_token which has not been verified"); 5648 "Cannot wait on sync_token which has not been verified");
5648 return; 5649 return;
5649 } 5650 }
5650 5651
5651 helper_->WaitSyncTokenCHROMIUM( 5652 helper_->WaitSyncTokenCHROMIUM(
5652 static_cast<GLint>(sync_token_data.namespace_id()), 5653 static_cast<GLint>(sync_token_data.namespace_id()),
5653 sync_token_data.command_buffer_id(), sync_token_data.release_count()); 5654 sync_token_data.command_buffer_id().GetUnsafeValue(),
5655 sync_token_data.release_count());
5654 } 5656 }
5655 } 5657 }
5656 } 5658 }
5657 5659
5658 namespace { 5660 namespace {
5659 5661
5660 bool ValidImageFormat(GLenum internalformat, 5662 bool ValidImageFormat(GLenum internalformat,
5661 const Capabilities& capabilities) { 5663 const Capabilities& capabilities) {
5662 switch (internalformat) { 5664 switch (internalformat) {
5663 case GL_ATC_RGB_AMD: 5665 case GL_ATC_RGB_AMD:
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
6545 CheckGLError(); 6547 CheckGLError();
6546 } 6548 }
6547 6549
6548 // Include the auto-generated part of this file. We split this because it means 6550 // Include the auto-generated part of this file. We split this because it means
6549 // we can easily edit the non-auto generated parts right here in this file 6551 // we can easily edit the non-auto generated parts right here in this file
6550 // instead of having to edit some template or the code generator. 6552 // instead of having to edit some template or the code generator.
6551 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 6553 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
6552 6554
6553 } // namespace gles2 6555 } // namespace gles2
6554 } // namespace gpu 6556 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/client_test_helper.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