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

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

Issue 10829209: Add GL_CHROMIUM_texture_mailbox entrypoints to wgc3d implementations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 if (!visible_ && free_command_buffer_when_invisible_) 938 if (!visible_ && free_command_buffer_when_invisible_)
939 gl_->FreeEverything(); 939 gl_->FreeEverything();
940 } 940 }
941 941
942 void WebGraphicsContext3DCommandBufferImpl::flush() { 942 void WebGraphicsContext3DCommandBufferImpl::flush() {
943 gl_->Flush(); 943 gl_->Flush();
944 if (!visible_ && free_command_buffer_when_invisible_) 944 if (!visible_ && free_command_buffer_when_invisible_)
945 gl_->FreeEverything(); 945 gl_->FreeEverything();
946 } 946 }
947 947
948 void WebGraphicsContext3DCommandBufferImpl::shallowFlushCHROMIUM() {
949 gl_->ShallowFlushCHROMIUM();
950 }
951
952 DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer, 948 DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbuffer,
953 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId) 949 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId)
954 950
955 DELEGATE_TO_GL_5(framebufferTexture2D, FramebufferTexture2D, 951 DELEGATE_TO_GL_5(framebufferTexture2D, FramebufferTexture2D,
956 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId, WGC3Dint) 952 WGC3Denum, WGC3Denum, WGC3Denum, WebGLId, WGC3Dint)
957 953
958 DELEGATE_TO_GL_1(frontFace, FrontFace, WGC3Denum) 954 DELEGATE_TO_GL_1(frontFace, FrontFace, WGC3Denum)
959 955
960 DELEGATE_TO_GL_1(generateMipmap, GenerateMipmap, WGC3Denum) 956 DELEGATE_TO_GL_1(generateMipmap, GenerateMipmap, WGC3Denum)
961 957
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 DELEGATE_TO_GL_3(getQueryivEXT, GetQueryivEXT, WGC3Denum, WGC3Denum, WGC3Dint*) 1525 DELEGATE_TO_GL_3(getQueryivEXT, GetQueryivEXT, WGC3Denum, WGC3Denum, WGC3Dint*)
1530 DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivEXT, 1526 DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivEXT,
1531 WebGLId, WGC3Denum, WGC3Duint*) 1527 WebGLId, WGC3Denum, WGC3Duint*)
1532 1528
1533 DELEGATE_TO_GL_5(copyTextureCHROMIUM, CopyTextureCHROMIUM, WGC3Denum, 1529 DELEGATE_TO_GL_5(copyTextureCHROMIUM, CopyTextureCHROMIUM, WGC3Denum,
1534 WebGLId, WebGLId, WGC3Dint, WGC3Denum); 1530 WebGLId, WebGLId, WGC3Dint, WGC3Denum);
1535 1531
1536 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM, 1532 DELEGATE_TO_GL_3(bindUniformLocationCHROMIUM, BindUniformLocationCHROMIUM,
1537 WebGLId, WGC3Dint, const WGC3Dchar*) 1533 WebGLId, WGC3Dint, const WGC3Dchar*)
1538 1534
1535 DELEGATE_TO_GL(shallowFlushCHROMIUM,ShallowFlushCHROMIUM);
1536
1537 DELEGATE_TO_GL_1(genMailboxCHROMIUM, GenMailboxCHROMIUM, WGC3Dbyte*)
1538 DELEGATE_TO_GL_2(produceTextureCHROMIUM, ProduceTextureCHROMIUM,
1539 WGC3Denum, const WGC3Dbyte*)
1540 DELEGATE_TO_GL_2(consumeTextureCHROMIUM, ConsumeTextureCHROMIUM,
1541 WGC3Denum, const WGC3Dbyte*)
1542
1539 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() { 1543 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::onCreateGrGLInterface() {
1540 return webkit_glue::CreateCommandBufferSkiaGLBinding(); 1544 return webkit_glue::CreateCommandBufferSkiaGLBinding();
1541 } 1545 }
1542 1546
1543 namespace { 1547 namespace {
1544 1548
1545 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { 1549 WGC3Denum convertReason(gpu::error::ContextLostReason reason) {
1546 switch (reason) { 1550 switch (reason) {
1547 case gpu::error::kGuilty: 1551 case gpu::error::kGuilty:
1548 return GL_GUILTY_CONTEXT_RESET_ARB; 1552 return GL_GUILTY_CONTEXT_RESET_ARB;
(...skipping 21 matching lines...) Expand all
1570 swap_client_->OnViewContextSwapBuffersAborted(); 1574 swap_client_->OnViewContextSwapBuffersAborted();
1571 } 1575 }
1572 1576
1573 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( 1577 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage(
1574 const std::string& message, int id) { 1578 const std::string& message, int id) {
1575 if (error_message_callback_) { 1579 if (error_message_callback_) {
1576 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); 1580 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str());
1577 error_message_callback_->onErrorMessage(str, id); 1581 error_message_callback_->onErrorMessage(str, id);
1578 } 1582 }
1579 } 1583 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698