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 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 | 6 |
7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 if (ShouldUseSwapClient()) { | 1155 if (ShouldUseSwapClient()) { |
1156 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( | 1156 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( |
1157 &WGC3DSwapClient::OnViewContextSwapBuffersComplete, swap_client_)); | 1157 &WGC3DSwapClient::OnViewContextSwapBuffersComplete, swap_client_)); |
1158 } | 1158 } |
1159 | 1159 |
1160 if (swapbuffers_complete_callback_) | 1160 if (swapbuffers_complete_callback_) |
1161 swapbuffers_complete_callback_->onSwapBuffersComplete(); | 1161 swapbuffers_complete_callback_->onSwapBuffersComplete(); |
1162 } | 1162 } |
1163 | 1163 |
1164 void WebGraphicsContext3DCommandBufferImpl::OnMemoryAllocationChanged( | 1164 void WebGraphicsContext3DCommandBufferImpl::OnMemoryAllocationChanged( |
1165 const GpuMemoryAllocation& allocation) { | 1165 const GpuMemoryAllocationForRenderer& allocation) { |
1166 if (memory_allocation_changed_callback_) | 1166 if (memory_allocation_changed_callback_) |
1167 memory_allocation_changed_callback_->onMemoryAllocationChanged( | 1167 memory_allocation_changed_callback_->onMemoryAllocationChanged( |
1168 allocation.gpu_resource_size_in_bytes); | 1168 WebKit::WebGraphicsMemoryAllocation( |
| 1169 allocation.gpu_resource_size_in_bytes, |
| 1170 allocation.suggest_have_backbuffer)); |
1169 } | 1171 } |
1170 | 1172 |
1171 void WebGraphicsContext3DCommandBufferImpl::setErrorMessageCallback( | 1173 void WebGraphicsContext3DCommandBufferImpl::setErrorMessageCallback( |
1172 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) { | 1174 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* cb) { |
1173 error_message_callback_ = cb; | 1175 error_message_callback_ = cb; |
1174 } | 1176 } |
1175 | 1177 |
1176 void WebGraphicsContext3DCommandBufferImpl::setContextLostCallback( | 1178 void WebGraphicsContext3DCommandBufferImpl::setContextLostCallback( |
1177 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) { | 1179 WebGraphicsContext3D::WebGraphicsContextLostCallback* cb) { |
1178 context_lost_callback_ = cb; | 1180 context_lost_callback_ = cb; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 } | 1256 } |
1255 | 1257 |
1256 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1258 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1257 const std::string& message, int id) { | 1259 const std::string& message, int id) { |
1258 if (error_message_callback_) { | 1260 if (error_message_callback_) { |
1259 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1261 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1260 error_message_callback_->onErrorMessage(str, id); | 1262 error_message_callback_->onErrorMessage(str, id); |
1261 } | 1263 } |
1262 } | 1264 } |
1263 | 1265 |
OLD | NEW |