| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 706 |
| 707 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, | 707 ResourceProvider::ScopedWriteLockGL lock(resource_provider_, |
| 708 resource->resource_id(), false); | 708 resource->resource_id(), false); |
| 709 DCHECK_EQ( | 709 DCHECK_EQ( |
| 710 resource_provider_->GetResourceTextureTarget(resource->resource_id()), | 710 resource_provider_->GetResourceTextureTarget(resource->resource_id()), |
| 711 (GLenum)GL_TEXTURE_2D); | 711 (GLenum)GL_TEXTURE_2D); |
| 712 | 712 |
| 713 gl->WaitSyncTokenCHROMIUM(mailbox_holder.sync_token.GetConstData()); | 713 gl->WaitSyncTokenCHROMIUM(mailbox_holder.sync_token.GetConstData()); |
| 714 uint32_t src_texture_id = gl->CreateAndConsumeTextureCHROMIUM( | 714 uint32_t src_texture_id = gl->CreateAndConsumeTextureCHROMIUM( |
| 715 mailbox_holder.texture_target, mailbox_holder.mailbox.name); | 715 mailbox_holder.texture_target, mailbox_holder.mailbox.name); |
| 716 gl->CopySubTextureCHROMIUM(src_texture_id, lock.texture_id(), 0, 0, 0, 0, | 716 gl->CopySubTextureCHROMIUM(src_texture_id, 0, lock.texture_id(), 0, 0, 0, 0, |
| 717 output_plane_resource_size.width(), | 717 0, output_plane_resource_size.width(), |
| 718 output_plane_resource_size.height(), false, false, | 718 output_plane_resource_size.height(), false, false, |
| 719 false); | 719 false); |
| 720 gl->DeleteTextures(1, &src_texture_id); | 720 gl->DeleteTextures(1, &src_texture_id); |
| 721 | 721 |
| 722 // Done with the source video frame texture at this point. | 722 // Done with the source video frame texture at this point. |
| 723 video_frame->UpdateReleaseSyncToken(&client); | 723 video_frame->UpdateReleaseSyncToken(&client); |
| 724 | 724 |
| 725 // VideoResourceUpdater shares a context with the compositor so a | 725 // VideoResourceUpdater shares a context with the compositor so a |
| 726 // sync token is not required. | 726 // sync token is not required. |
| 727 TextureMailbox mailbox(resource->mailbox(), gpu::SyncToken(), GL_TEXTURE_2D, | 727 TextureMailbox mailbox(resource->mailbox(), gpu::SyncToken(), GL_TEXTURE_2D, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 if (lost_resource) { | 812 if (lost_resource) { |
| 813 resource_it->clear_refs(); | 813 resource_it->clear_refs(); |
| 814 updater->DeleteResource(resource_it); | 814 updater->DeleteResource(resource_it); |
| 815 return; | 815 return; |
| 816 } | 816 } |
| 817 | 817 |
| 818 resource_it->remove_ref(); | 818 resource_it->remove_ref(); |
| 819 } | 819 } |
| 820 | 820 |
| 821 } // namespace cc | 821 } // namespace cc |
| OLD | NEW |