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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
6 | 6 |
7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
8 | 8 |
9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
(...skipping 3578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3589 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureCHROMIUM(" | 3589 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureCHROMIUM(" |
3590 << static_cast<const void*>(data) << ")"); | 3590 << static_cast<const void*>(data) << ")"); |
3591 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | 3591 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
3592 DCHECK(mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a " | 3592 DCHECK(mailbox.Verify()) << "ProduceTextureCHROMIUM was passed a " |
3593 "mailbox that was not generated by " | 3593 "mailbox that was not generated by " |
3594 "GenMailboxCHROMIUM."; | 3594 "GenMailboxCHROMIUM."; |
3595 helper_->ProduceTextureCHROMIUMImmediate(target, data); | 3595 helper_->ProduceTextureCHROMIUMImmediate(target, data); |
3596 CheckGLError(); | 3596 CheckGLError(); |
3597 } | 3597 } |
3598 | 3598 |
| 3599 void GLES2Implementation::ProduceTextureBindlessCHROMIUM( |
| 3600 GLuint texture, GLenum target, const GLbyte* data) { |
| 3601 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3602 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glProduceTextureBindlessCHROMIUM(" |
| 3603 << static_cast<const void*>(data) << ")"); |
| 3604 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
| 3605 DCHECK(mailbox.Verify()) << "ProduceTextureBindlessCHROMIUM was passed a " |
| 3606 "mailbox that was not generated by " |
| 3607 "GenMailboxCHROMIUM."; |
| 3608 helper_->ProduceTextureBindlessCHROMIUMImmediate(texture, target, data); |
| 3609 CheckGLError(); |
| 3610 } |
| 3611 |
3599 void GLES2Implementation::ConsumeTextureCHROMIUM(GLenum target, | 3612 void GLES2Implementation::ConsumeTextureCHROMIUM(GLenum target, |
3600 const GLbyte* data) { | 3613 const GLbyte* data) { |
3601 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3614 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
3602 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glConsumeTextureCHROMIUM(" | 3615 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glConsumeTextureCHROMIUM(" |
3603 << static_cast<const void*>(data) << ")"); | 3616 << static_cast<const void*>(data) << ")"); |
3604 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); | 3617 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
3605 DCHECK(mailbox.Verify()) << "ConsumeTextureCHROMIUM was passed a " | 3618 DCHECK(mailbox.Verify()) << "ConsumeTextureCHROMIUM was passed a " |
3606 "mailbox that was not generated by " | 3619 "mailbox that was not generated by " |
3607 "GenMailboxCHROMIUM."; | 3620 "GenMailboxCHROMIUM."; |
3608 helper_->ConsumeTextureCHROMIUMImmediate(target, data); | 3621 helper_->ConsumeTextureCHROMIUMImmediate(target, data); |
3609 CheckGLError(); | 3622 CheckGLError(); |
3610 } | 3623 } |
3611 | 3624 |
| 3625 GLuint GLES2Implementation::CreateAndConsumeTextureCHROMIUM( |
| 3626 GLenum target, const GLbyte* data) { |
| 3627 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
| 3628 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCreateAndConsumeTextureCHROMIUM(" |
| 3629 << static_cast<const void*>(data) << ")"); |
| 3630 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); |
| 3631 DCHECK(mailbox.Verify()) << "CreateAndConsumeTextureCHROMIUM was passed a " |
| 3632 "mailbox that was not generated by " |
| 3633 "GenMailboxCHROMIUM."; |
| 3634 GLuint client_id; |
| 3635 GetIdHandler(id_namespaces::kTextures)->MakeIds(this, 0, 1, &client_id); |
| 3636 helper_->CreateAndConsumeTextureCHROMIUMImmediate(target, |
| 3637 client_id, data); |
| 3638 CheckGLError(); |
| 3639 return client_id; |
| 3640 } |
| 3641 |
3612 void GLES2Implementation::PushGroupMarkerEXT( | 3642 void GLES2Implementation::PushGroupMarkerEXT( |
3613 GLsizei length, const GLchar* marker) { | 3643 GLsizei length, const GLchar* marker) { |
3614 GPU_CLIENT_SINGLE_THREAD_CHECK(); | 3644 GPU_CLIENT_SINGLE_THREAD_CHECK(); |
3615 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" | 3645 GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPushGroupMarkerEXT(" |
3616 << length << ", " << marker << ")"); | 3646 << length << ", " << marker << ")"); |
3617 if (!marker) { | 3647 if (!marker) { |
3618 marker = ""; | 3648 marker = ""; |
3619 } | 3649 } |
3620 SetBucketAsString( | 3650 SetBucketAsString( |
3621 kResultBucketId, | 3651 kResultBucketId, |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4136 return true; | 4166 return true; |
4137 } | 4167 } |
4138 | 4168 |
4139 // Include the auto-generated part of this file. We split this because it means | 4169 // Include the auto-generated part of this file. We split this because it means |
4140 // we can easily edit the non-auto generated parts right here in this file | 4170 // we can easily edit the non-auto generated parts right here in this file |
4141 // instead of having to edit some template or the code generator. | 4171 // instead of having to edit some template or the code generator. |
4142 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 4172 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
4143 | 4173 |
4144 } // namespace gles2 | 4174 } // namespace gles2 |
4145 } // namespace gpu | 4175 } // namespace gpu |
OLD | NEW |