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

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: response to piman feedback Created 7 years, 5 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/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | 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 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 scoped_ptr<WebGraphicsSyncPointCallback> own_callback(callback); 1546 scoped_ptr<WebGraphicsSyncPointCallback> own_callback(callback);
1547 // Flush any pending commands to make sure that the the query 1547 // Flush any pending commands to make sure that the the query
1548 // has actually been created/started before we try to attach 1548 // has actually been created/started before we try to attach
1549 // a callback to it. 1549 // a callback to it.
1550 gl_->Flush(); 1550 gl_->Flush();
1551 command_buffer_->SignalQuery( 1551 command_buffer_->SignalQuery(
1552 query, 1552 query,
1553 base::Bind(&SignalSyncPointCallback, base::Passed(&own_callback))); 1553 base::Bind(&SignalSyncPointCallback, base::Passed(&own_callback)));
1554 } 1554 }
1555 1555
1556 void WebGraphicsContext3DCommandBufferImpl::loseContextCHROMIUM(
1557 WGC3Denum current, WGC3Denum other) {
1558 gl_->LoseContextCHROMIUM(current, other);
1559 gl_->Flush();
1560 }
1561
1556 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM( 1562 void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM(
1557 WGC3Dbyte* name) { 1563 WGC3Dbyte* name) {
1558 std::vector<gpu::Mailbox> names; 1564 std::vector<gpu::Mailbox> names;
1559 if (command_buffer_->GenerateMailboxNames(1, &names)) 1565 if (command_buffer_->GenerateMailboxNames(1, &names))
1560 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM); 1566 memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM);
1561 else 1567 else
1562 synthesizeGLError(GL_OUT_OF_MEMORY); 1568 synthesizeGLError(GL_OUT_OF_MEMORY);
1563 } 1569 }
1564 1570
1565 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, 1571 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 1674
1669 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( 1675 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage(
1670 const std::string& message, int id) { 1676 const std::string& message, int id) {
1671 if (error_message_callback_) { 1677 if (error_message_callback_) {
1672 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); 1678 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str());
1673 error_message_callback_->onErrorMessage(str, id); 1679 error_message_callback_->onErrorMessage(str, id);
1674 } 1680 }
1675 } 1681 }
1676 1682
1677 } // namespace content 1683 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698