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

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

Issue 17176027: Add gpu command buffer support for loseContextCHROMIUM (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch 2 Created 7 years, 6 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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 void WebGraphicsContext3DCommandBufferImpl::signalSyncPoint( 1592 void WebGraphicsContext3DCommandBufferImpl::signalSyncPoint(
1593 unsigned sync_point, 1593 unsigned sync_point,
1594 WebGraphicsSyncPointCallback* callback) { 1594 WebGraphicsSyncPointCallback* callback) {
1595 // Take ownership of the callback. 1595 // Take ownership of the callback.
1596 scoped_ptr<WebGraphicsSyncPointCallback> own_callback(callback); 1596 scoped_ptr<WebGraphicsSyncPointCallback> own_callback(callback);
1597 command_buffer_->SignalSyncPoint( 1597 command_buffer_->SignalSyncPoint(
1598 sync_point, 1598 sync_point,
1599 base::Bind(&SignalSyncPointCallback, base::Passed(&own_callback))); 1599 base::Bind(&SignalSyncPointCallback, base::Passed(&own_callback)));
1600 } 1600 }
1601 1601
1602 void WebGraphicsContext3DCommandBufferImpl::loseContextCHROMIUM(
1603 WGC3Denum current, WGC3Denum other) {
1604 gl_->LoseContextCHROMIUM(current, other);
1605 gl_->Finish();
piman 2013/06/21 19:05:05 Actually, doing a Finish() here makes it less inte
1606 DCHECK(IsCommandBufferContextLost());
1607 }
1608
1602 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( 1609 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM(
1603 WGC3Dbyte* name) { 1610 WGC3Dbyte* name) {
1604 std::vector<gpu::Mailbox> names(1); 1611 std::vector<gpu::Mailbox> names(1);
1605 if (command_buffer_->GenerateMailboxNames(1, &names)) 1612 if (command_buffer_->GenerateMailboxNames(1, &names))
1606 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); 1613 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM);
1607 else 1614 else
1608 synthesizeGLError(GL_OUT_OF_MEMORY); 1615 synthesizeGLError(GL_OUT_OF_MEMORY);
1609 } 1616 }
1610 1617
1611 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, 1618 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 1738
1732 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( 1739 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage(
1733 const std::string& message, int id) { 1740 const std::string& message, int id) {
1734 if (error_message_callback_) { 1741 if (error_message_callback_) {
1735 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); 1742 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str());
1736 error_message_callback_->onErrorMessage(str, id); 1743 error_message_callback_->onErrorMessage(str, id);
1737 } 1744 }
1738 } 1745 }
1739 1746
1740 } // namespace content 1747 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698