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

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

Issue 1394543003: Added SyncToken command buffer trait to help with IPC messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 12 matching lines...) Expand all
23 #include "base/trace_event/process_memory_dump.h" 23 #include "base/trace_event/process_memory_dump.h"
24 #include "gpu/command_buffer/client/buffer_tracker.h" 24 #include "gpu/command_buffer/client/buffer_tracker.h"
25 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 25 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
26 #include "gpu/command_buffer/client/gpu_control.h" 26 #include "gpu/command_buffer/client/gpu_control.h"
27 #include "gpu/command_buffer/client/program_info_manager.h" 27 #include "gpu/command_buffer/client/program_info_manager.h"
28 #include "gpu/command_buffer/client/query_tracker.h" 28 #include "gpu/command_buffer/client/query_tracker.h"
29 #include "gpu/command_buffer/client/transfer_buffer.h" 29 #include "gpu/command_buffer/client/transfer_buffer.h"
30 #include "gpu/command_buffer/client/vertex_array_object_manager.h" 30 #include "gpu/command_buffer/client/vertex_array_object_manager.h"
31 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 31 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
32 #include "gpu/command_buffer/common/id_allocator.h" 32 #include "gpu/command_buffer/common/id_allocator.h"
33 #include "gpu/command_buffer/common/sync_token.h"
33 #include "gpu/command_buffer/common/trace_event.h" 34 #include "gpu/command_buffer/common/trace_event.h"
34 #include "ui/gfx/geometry/rect.h" 35 #include "ui/gfx/geometry/rect.h"
35 #include "ui/gfx/geometry/rect_f.h" 36 #include "ui/gfx/geometry/rect_f.h"
36 37
37 #if defined(GPU_CLIENT_DEBUG) 38 #if defined(GPU_CLIENT_DEBUG)
38 #include "base/command_line.h" 39 #include "base/command_line.h"
39 #include "gpu/command_buffer/client/gpu_switches.h" 40 #include "gpu/command_buffer/client/gpu_switches.h"
40 #endif 41 #endif
41 42
42 namespace gpu { 43 namespace gpu {
(...skipping 5338 matching lines...) Expand 10 before | Expand all | Expand 10 after
5381 return; 5382 return;
5382 } else if (!gpu_control_->IsFenceSyncFlushed(fence_sync)) { 5383 } else if (!gpu_control_->IsFenceSyncFlushed(fence_sync)) {
5383 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM", 5384 SetGLError(GL_INVALID_OPERATION, "glGenSyncTokenCHROMIUM",
5384 "fence sync must be flushed before generating sync token"); 5385 "fence sync must be flushed before generating sync token");
5385 return; 5386 return;
5386 } 5387 }
5387 5388
5388 SyncToken* sync_token_data = reinterpret_cast<SyncToken*>(sync_token); 5389 SyncToken* sync_token_data = reinterpret_cast<SyncToken*>(sync_token);
5389 memset(sync_token_data, 0, sizeof(SyncToken)); 5390 memset(sync_token_data, 0, sizeof(SyncToken));
5390 5391
5391 sync_token_data->namespace_id = gpu_control_->GetNamespaceID(); 5392 sync_token_data->SetData(gpu_control_->GetNamespaceID(),
5392 sync_token_data->command_buffer_id = gpu_control_->GetCommandBufferID(); 5393 gpu_control_->GetCommandBufferID(),
5393 sync_token_data->release_count = fence_sync; 5394 fence_sync);
5394 } 5395 }
5395 5396
5396 void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) { 5397 void GLES2Implementation::WaitSyncTokenCHROMIUM(const GLbyte* sync_token) {
5397 if (!sync_token) { 5398 if (!sync_token) {
5398 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", "empty sync_token"); 5399 SetGLError(GL_INVALID_VALUE, "glWaitSyncTokenCHROMIUM", "empty sync_token");
5399 return; 5400 return;
5400 }; 5401 };
5401 5402
5402 const SyncToken* sync_token_data = 5403 const SyncToken* sync_token_data =
5403 reinterpret_cast<const SyncToken*>(sync_token); 5404 reinterpret_cast<const SyncToken*>(sync_token);
5404 helper_->WaitSyncTokenCHROMIUM(sync_token_data->namespace_id, 5405 helper_->WaitSyncTokenCHROMIUM(sync_token_data->GetNamespaceId(),
5405 sync_token_data->command_buffer_id, 5406 sync_token_data->GetCommandBufferId(),
5406 sync_token_data->release_count); 5407 sync_token_data->GetReleaseCount());
5407 } 5408 }
5408 5409
5409 namespace { 5410 namespace {
5410 5411
5411 bool ValidImageFormat(GLenum internalformat, 5412 bool ValidImageFormat(GLenum internalformat,
5412 const Capabilities& capabilities) { 5413 const Capabilities& capabilities) {
5413 switch (internalformat) { 5414 switch (internalformat) {
5414 case GL_ATC_RGB_AMD: 5415 case GL_ATC_RGB_AMD:
5415 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: 5416 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD:
5416 return capabilities.texture_format_atc; 5417 return capabilities.texture_format_atc;
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
5924 CheckGLError(); 5925 CheckGLError();
5925 } 5926 }
5926 5927
5927 // Include the auto-generated part of this file. We split this because it means 5928 // Include the auto-generated part of this file. We split this because it means
5928 // we can easily edit the non-auto generated parts right here in this file 5929 // we can easily edit the non-auto generated parts right here in this file
5929 // instead of having to edit some template or the code generator. 5930 // instead of having to edit some template or the code generator.
5930 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" 5931 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h"
5931 5932
5932 } // namespace gles2 5933 } // namespace gles2
5933 } // namespace gpu 5934 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698