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

Side by Side Diff: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" 5 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <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 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1650 ClearContext(); 1650 ClearContext();
1651 return gl_->MapBufferCHROMIUM(target, access); 1651 return gl_->MapBufferCHROMIUM(target, access);
1652 } 1652 }
1653 1653
1654 WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl:: 1654 WGC3Dboolean WebGraphicsContext3DInProcessCommandBufferImpl::
1655 unmapBufferCHROMIUM(WGC3Denum target) { 1655 unmapBufferCHROMIUM(WGC3Denum target) {
1656 ClearContext(); 1656 ClearContext();
1657 return gl_->UnmapBufferCHROMIUM(target); 1657 return gl_->UnmapBufferCHROMIUM(target);
1658 } 1658 }
1659 1659
1660 void WebGraphicsContext3DInProcessCommandBufferImpl::loseContextCHROMIUM(
1661 WGC3Denum current, WGC3Denum other) {
1662 ClearContext();
1663 // TODO(danakj): Calling LoseContextCHROMIUM() on the command buffer also
1664 // prevents recreating a valid context. So we only simulate the loss for now.
1665 // http://crbug.com/166671
1666 context_lost_reason_ = current;
1667 }
1668
1660 GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: 1669 GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl::
1661 onCreateGrGLInterface() { 1670 onCreateGrGLInterface() {
1662 return CreateCommandBufferSkiaGLBinding(); 1671 return CreateCommandBufferSkiaGLBinding();
1663 } 1672 }
1664 1673
1665 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() { 1674 void WebGraphicsContext3DInProcessCommandBufferImpl::OnContextLost() {
1666 // TODO(kbr): improve the precision here. 1675 // TODO(kbr): improve the precision here.
1667 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; 1676 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB;
1668 if (context_lost_callback_) { 1677 if (context_lost_callback_) {
1669 context_lost_callback_->onContextLost(); 1678 context_lost_callback_->onContextLost();
1670 } 1679 }
1671 } 1680 }
1672 1681
1673 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, 1682 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM,
1674 WebGLId, WGC3Dint, const WGC3Dchar*) 1683 WebGLId, WGC3Dint, const WGC3Dchar*)
1675 1684
1676 DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM) 1685 DELEGATE_TO_GL(shallowFlushCHROMIUM, ShallowFlushCHROMIUM)
1677 1686
1678 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*) 1687 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*)
1679 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM, 1688 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM,
1680 WGC3Denum, const WGC3Dbyte*) 1689 WGC3Denum, const WGC3Dbyte*)
1681 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM, 1690 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM,
1682 WGC3Denum, const WGC3Dbyte*) 1691 WGC3Denum, const WGC3Dbyte*)
1683 1692
1684 } // namespace gpu 1693 } // namespace gpu
1685 } // namespace webkit 1694 } // namespace webkit
OLDNEW
« cc/thread_proxy.cc ('K') | « webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698