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/gl_helper.h" | 5 #include "content/common/gpu/client/gl_helper.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 void GLHelper::DeleteTexture(blink::WebGLId texture_id) { | 699 void GLHelper::DeleteTexture(blink::WebGLId texture_id) { |
700 context_->deleteTexture(texture_id); | 700 context_->deleteTexture(texture_id); |
701 } | 701 } |
702 | 702 |
703 uint32 GLHelper::InsertSyncPoint() { return context_->insertSyncPoint(); } | 703 uint32 GLHelper::InsertSyncPoint() { return context_->insertSyncPoint(); } |
704 | 704 |
705 void GLHelper::WaitSyncPoint(uint32 sync_point) { | 705 void GLHelper::WaitSyncPoint(uint32 sync_point) { |
706 context_->waitSyncPoint(sync_point); | 706 context_->waitSyncPoint(sync_point); |
707 } | 707 } |
708 | 708 |
709 gpu::Mailbox GLHelper::ProduceMailboxFromTexture(blink::WebGLId texture_id, | 709 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( |
710 uint32* sync_point) { | 710 blink::WebGLId texture_id) { |
711 gpu::Mailbox mailbox; | 711 gpu::Mailbox mailbox; |
712 context_->genMailboxCHROMIUM(mailbox.name); | 712 context_->genMailboxCHROMIUM(mailbox.name); |
713 if (mailbox.IsZero()) { | 713 if (mailbox.IsZero()) |
714 *sync_point = 0; | 714 return gpu::MailboxHolder(); |
715 return mailbox; | |
716 } | |
717 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, | 715 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, |
718 texture_id); | 716 texture_id); |
719 context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 717 context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
720 *sync_point = context_->insertSyncPoint(); | 718 return gpu::MailboxHolder( |
721 return mailbox; | 719 mailbox, GL_TEXTURE_2D, context_->insertSyncPoint()); |
722 } | 720 } |
723 | 721 |
724 blink::WebGLId GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, | 722 blink::WebGLId GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, |
725 uint32 sync_point) { | 723 uint32 sync_point) { |
726 if (mailbox.IsZero()) | 724 if (mailbox.IsZero()) |
727 return 0; | 725 return 0; |
728 if (sync_point) | 726 if (sync_point) |
729 context_->waitSyncPoint(sync_point); | 727 context_->waitSyncPoint(sync_point); |
730 blink::WebGLId texture = CreateTexture(); | 728 blink::WebGLId texture = CreateTexture(); |
731 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, | 729 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(context_, |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 quality, | 1082 quality, |
1085 src_size, | 1083 src_size, |
1086 src_subrect, | 1084 src_subrect, |
1087 dst_size, | 1085 dst_size, |
1088 dst_subrect, | 1086 dst_subrect, |
1089 flip_vertically, | 1087 flip_vertically, |
1090 use_mrt); | 1088 use_mrt); |
1091 } | 1089 } |
1092 | 1090 |
1093 } // namespace content | 1091 } // namespace content |
OLD | NEW |