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

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

Issue 165393003: gpu: Generate mailboxes on client side (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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/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 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 uint32 GLHelper::InsertSyncPoint() { return gl_->InsertSyncPointCHROMIUM(); } 820 uint32 GLHelper::InsertSyncPoint() { return gl_->InsertSyncPointCHROMIUM(); }
821 821
822 void GLHelper::WaitSyncPoint(uint32 sync_point) { 822 void GLHelper::WaitSyncPoint(uint32 sync_point) {
823 gl_->WaitSyncPointCHROMIUM(sync_point); 823 gl_->WaitSyncPointCHROMIUM(sync_point);
824 } 824 }
825 825
826 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture( 826 gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture(
827 GLuint texture_id) { 827 GLuint texture_id) {
828 gpu::Mailbox mailbox; 828 gpu::Mailbox mailbox;
829 gl_->GenMailboxCHROMIUM(mailbox.name); 829 gl_->GenMailboxCHROMIUM(mailbox.name);
830 if (mailbox.IsZero())
831 return gpu::MailboxHolder();
832 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(gl_, texture_id); 830 content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(gl_, texture_id);
833 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); 831 gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
834 return gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, InsertSyncPoint()); 832 return gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, InsertSyncPoint());
835 } 833 }
836 834
837 GLuint GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox, 835 GLuint GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
838 uint32 sync_point) { 836 uint32 sync_point) {
839 if (mailbox.IsZero()) 837 if (mailbox.IsZero())
840 return 0; 838 return 0;
841 if (sync_point) 839 if (sync_point)
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, 1233 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality,
1236 src_size, 1234 src_size,
1237 src_subrect, 1235 src_subrect,
1238 dst_size, 1236 dst_size,
1239 dst_subrect, 1237 dst_subrect,
1240 flip_vertically, 1238 flip_vertically,
1241 use_mrt); 1239 use_mrt);
1242 } 1240 }
1243 1241
1244 } // namespace content 1242 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698