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

Side by Side Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 9702081: Splitting GpuMemoryAllocation into two parts: for renderer and browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding unittests for GpuMemoryAllocation comparison functions since they have become not as trivial. Created 8 years, 9 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 | Annotate | Revision Log
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 #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
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
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
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698