Chromium Code Reviews| 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 "../client/gles2_implementation.h" | 7 #include "../client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1048 void GLES2Implementation::Flush() { | 1048 void GLES2Implementation::Flush() { |
| 1049 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 1049 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 1050 GPU_CLIENT_LOG("[" << this << "] glFlush()"); | 1050 GPU_CLIENT_LOG("[" << this << "] glFlush()"); |
| 1051 // Insert the cmd to call glFlush | 1051 // Insert the cmd to call glFlush |
| 1052 helper_->Flush(); | 1052 helper_->Flush(); |
| 1053 // Flush our command buffer | 1053 // Flush our command buffer |
| 1054 // (tell the service to execute up to the flush cmd.) | 1054 // (tell the service to execute up to the flush cmd.) |
| 1055 helper_->CommandBufferHelper::Flush(); | 1055 helper_->CommandBufferHelper::Flush(); |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 void GLES2Implementation::ShallowFlushCHROMIUM() { | |
| 1059 GPU_CLIENT_SINGLE_THREAD_CHECK(); | |
| 1060 GPU_CLIENT_LOG("[" << this << "] glShallowFlushCHROMIUM()"); | |
| 1061 // Flush our command buffer | |
| 1062 // (tell the service to execute up to the flush cmd.) | |
| 1063 helper_->CommandBufferHelper::Flush(); | |
| 1064 } | |
| 1065 | |
| 1058 void GLES2Implementation::Finish() { | 1066 void GLES2Implementation::Finish() { |
| 1059 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 1067 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 1060 FinishHelper(); | 1068 FinishHelper(); |
| 1061 } | 1069 } |
| 1062 | 1070 |
| 1063 void GLES2Implementation::FinishHelper() { | 1071 void GLES2Implementation::FinishHelper() { |
| 1064 GPU_CLIENT_LOG("[" << this << "] glFinish()"); | 1072 GPU_CLIENT_LOG("[" << this << "] glFinish()"); |
| 1065 TRACE_EVENT0("gpu", "GLES2::Finish"); | 1073 TRACE_EVENT0("gpu", "GLES2::Finish"); |
| 1066 // Insert the cmd to call glFinish | 1074 // Insert the cmd to call glFinish |
| 1067 helper_->Finish(); | 1075 helper_->Finish(); |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2113 const char* result = NULL; | 2121 const char* result = NULL; |
| 2114 // Clears the bucket so if the command fails nothing will be in it. | 2122 // Clears the bucket so if the command fails nothing will be in it. |
| 2115 helper_->SetBucketSize(kResultBucketId, 0); | 2123 helper_->SetBucketSize(kResultBucketId, 0); |
| 2116 helper_->GetString(name, kResultBucketId); | 2124 helper_->GetString(name, kResultBucketId); |
| 2117 std::string str; | 2125 std::string str; |
| 2118 if (GetBucketAsString(kResultBucketId, &str)) { | 2126 if (GetBucketAsString(kResultBucketId, &str)) { |
| 2119 // Adds extensions implemented on client side only. | 2127 // Adds extensions implemented on client side only. |
| 2120 switch (name) { | 2128 switch (name) { |
| 2121 case GL_EXTENSIONS: | 2129 case GL_EXTENSIONS: |
| 2122 str += std::string(str.empty() ? "" : " ") + | 2130 str += std::string(str.empty() ? "" : " ") + |
| 2131 "GL_CHROMIUM_shallow_flush " | |
|
brianderson
2012/07/19 03:29:44
The extension is advertised here and I double chec
| |
| 2123 "GL_CHROMIUM_map_sub " | 2132 "GL_CHROMIUM_map_sub " |
| 2124 "GL_CHROMIUM_flipy " | 2133 "GL_CHROMIUM_flipy " |
| 2125 "GL_EXT_unpack_subimage"; | 2134 "GL_EXT_unpack_subimage"; |
| 2126 break; | 2135 break; |
| 2127 default: | 2136 default: |
| 2128 break; | 2137 break; |
| 2129 } | 2138 } |
| 2130 | 2139 |
| 2131 // Because of WebGL the extensions can change. We have to cache each unique | 2140 // Because of WebGL the extensions can change. We have to cache each unique |
| 2132 // result since we don't know when the client will stop referring to a | 2141 // result since we don't know when the client will stop referring to a |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3298 helper_->GenMailboxCHROMIUM(kResultBucketId); | 3307 helper_->GenMailboxCHROMIUM(kResultBucketId); |
| 3299 | 3308 |
| 3300 std::vector<GLbyte> result; | 3309 std::vector<GLbyte> result; |
| 3301 GetBucketContents(kResultBucketId, &result); | 3310 GetBucketContents(kResultBucketId, &result); |
| 3302 | 3311 |
| 3303 std::copy(result.begin(), result.end(), mailbox); | 3312 std::copy(result.begin(), result.end(), mailbox); |
| 3304 } | 3313 } |
| 3305 | 3314 |
| 3306 } // namespace gles2 | 3315 } // namespace gles2 |
| 3307 } // namespace gpu | 3316 } // namespace gpu |
| OLD | NEW |