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

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

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 } 1425 }
1426 1426
1427 bool WebGraphicsContext3DCommandBufferImpl::ShouldUseSwapClient() { 1427 bool WebGraphicsContext3DCommandBufferImpl::ShouldUseSwapClient() {
1428 return factory_ && factory_->IsMainThread() && swap_client_.get(); 1428 return factory_ && factory_->IsMainThread() && swap_client_.get();
1429 } 1429 }
1430 1430
1431 void WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete() { 1431 void WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete() {
1432 typedef WebGraphicsContext3DSwapBuffersClient WGC3DSwapClient; 1432 typedef WebGraphicsContext3DSwapBuffersClient WGC3DSwapClient;
1433 // This may be called after tear-down of the RenderView. 1433 // This may be called after tear-down of the RenderView.
1434 if (ShouldUseSwapClient()) { 1434 if (ShouldUseSwapClient()) {
1435 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 1435 base::MessageLoop::current()->PostTask(
1436 &WGC3DSwapClient::OnViewContextSwapBuffersComplete, swap_client_)); 1436 FROM_HERE,
1437 base::Bind(&WGC3DSwapClient::OnViewContextSwapBuffersComplete,
1438 swap_client_));
1437 } 1439 }
1438 1440
1439 if (swapbuffers_complete_callback_) 1441 if (swapbuffers_complete_callback_)
1440 swapbuffers_complete_callback_->onSwapBuffersComplete(); 1442 swapbuffers_complete_callback_->onSwapBuffersComplete();
1441 } 1443 }
1442 1444
1443 WebGraphicsMemoryAllocation::PriorityCutoff 1445 WebGraphicsMemoryAllocation::PriorityCutoff
1444 WebGraphicsContext3DCommandBufferImpl::WebkitPriorityCutoff( 1446 WebGraphicsContext3DCommandBufferImpl::WebkitPriorityCutoff(
1445 GpuMemoryAllocationForRenderer::PriorityCutoff priorityCutoff) { 1447 GpuMemoryAllocationForRenderer::PriorityCutoff priorityCutoff) {
1446 switch (priorityCutoff) { 1448 switch (priorityCutoff) {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 1742
1741 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( 1743 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage(
1742 const std::string& message, int id) { 1744 const std::string& message, int id) {
1743 if (error_message_callback_) { 1745 if (error_message_callback_) {
1744 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); 1746 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str());
1745 error_message_callback_->onErrorMessage(str, id); 1747 error_message_callback_->onErrorMessage(str, id);
1746 } 1748 }
1747 } 1749 }
1748 1750
1749 } // namespace content 1751 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698