OLD | NEW |
---|---|
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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1531 WGC3Dintptr offset, | 1531 WGC3Dintptr offset, |
1532 WGC3Dsizei primcount) { | 1532 WGC3Dsizei primcount) { |
1533 gl_->DrawElementsInstancedANGLE( | 1533 gl_->DrawElementsInstancedANGLE( |
1534 mode, count, type, | 1534 mode, count, type, |
1535 reinterpret_cast<void*>(static_cast<intptr_t>(offset)), primcount); | 1535 reinterpret_cast<void*>(static_cast<intptr_t>(offset)), primcount); |
1536 } | 1536 } |
1537 | 1537 |
1538 DELEGATE_TO_GL_2(vertexAttribDivisorANGLE, VertexAttribDivisorANGLE, WGC3Duint, | 1538 DELEGATE_TO_GL_2(vertexAttribDivisorANGLE, VertexAttribDivisorANGLE, WGC3Duint, |
1539 WGC3Duint) | 1539 WGC3Duint) |
1540 | 1540 |
1541 WGC3Duint WebGraphicsContext3DCommandBufferImpl::createImageCHROMIUM( | |
1542 WGC3Dsizei width, WGC3Dsizei height, WGC3Denum internalformat) { | |
1543 return gl_->CreateImageCHROMIUM(width, height, internalformat); | |
1544 } | |
piman
2013/10/21 21:57:00
nit: DELEGATE_TO_GL_3R should work, right?
reveman
2013/10/22 16:26:11
There was no DELEGATE_TO_GL_3R macro before this b
| |
1545 | |
1546 DELEGATE_TO_GL_1(destroyImageCHROMIUM, DestroyImageCHROMIUM, WGC3Duint); | |
1547 | |
1548 DELEGATE_TO_GL_3(getImageParameterivCHROMIUM, GetImageParameterivCHROMIUM, | |
1549 WGC3Duint, WGC3Denum, GLint*); | |
1550 | |
1551 DELEGATE_TO_GL_2R(mapImageCHROMIUM, MapImageCHROMIUM, | |
1552 WGC3Duint, WGC3Denum, void*); | |
1553 | |
1554 DELEGATE_TO_GL_1(unmapImageCHROMIUM, UnmapImageCHROMIUM, WGC3Duint); | |
1555 | |
1541 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::createGrGLInterface() { | 1556 GrGLInterface* WebGraphicsContext3DCommandBufferImpl::createGrGLInterface() { |
1542 return webkit::gpu::CreateCommandBufferSkiaGLBinding(); | 1557 return webkit::gpu::CreateCommandBufferSkiaGLBinding(); |
1543 } | 1558 } |
1544 | 1559 |
1545 namespace { | 1560 namespace { |
1546 | 1561 |
1547 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { | 1562 WGC3Denum convertReason(gpu::error::ContextLostReason reason) { |
1548 switch (reason) { | 1563 switch (reason) { |
1549 case gpu::error::kGuilty: | 1564 case gpu::error::kGuilty: |
1550 return GL_GUILTY_CONTEXT_RESET_ARB; | 1565 return GL_GUILTY_CONTEXT_RESET_ARB; |
(...skipping 23 matching lines...) Expand all Loading... | |
1574 | 1589 |
1575 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1590 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1576 const std::string& message, int id) { | 1591 const std::string& message, int id) { |
1577 if (error_message_callback_) { | 1592 if (error_message_callback_) { |
1578 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); | 1593 WebKit::WebString str = WebKit::WebString::fromUTF8(message.c_str()); |
1579 error_message_callback_->onErrorMessage(str, id); | 1594 error_message_callback_->onErrorMessage(str, id); |
1580 } | 1595 } |
1581 } | 1596 } |
1582 | 1597 |
1583 } // namespace content | 1598 } // namespace content |
OLD | NEW |