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 "media/renderers/skcanvas_video_renderer.h" | 5 #include "media/renderers/skcanvas_video_renderer.h" |
6 | 6 |
7 #include "gpu/GLES2/gl2extchromium.h" | 7 #include "gpu/GLES2/gl2extchromium.h" |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "gpu/command_buffer/common/mailbox_holder.h" | 9 #include "gpu/command_buffer/common/mailbox_holder.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 int result; | 56 int result; |
57 return video_frame->metadata()->GetInteger(VideoFrameMetadata::COLOR_SPACE, | 57 return video_frame->metadata()->GetInteger(VideoFrameMetadata::COLOR_SPACE, |
58 &result) && | 58 &result) && |
59 result == color_space; | 59 result == color_space; |
60 } | 60 } |
61 | 61 |
62 class SyncTokenClientImpl : public VideoFrame::SyncTokenClient { | 62 class SyncTokenClientImpl : public VideoFrame::SyncTokenClient { |
63 public: | 63 public: |
64 explicit SyncTokenClientImpl(gpu::gles2::GLES2Interface* gl) : gl_(gl) {} | 64 explicit SyncTokenClientImpl(gpu::gles2::GLES2Interface* gl) : gl_(gl) {} |
65 ~SyncTokenClientImpl() override {} | 65 ~SyncTokenClientImpl() override {} |
66 uint32 InsertSyncPoint() override { return gl_->InsertSyncPointCHROMIUM(); } | 66 void GenerateSyncToken(gpu::SyncToken* sync_token) override { |
| 67 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); |
| 68 gl_->ShallowFlushCHROMIUM(); |
| 69 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData()); |
| 70 } |
67 void WaitSyncToken(const gpu::SyncToken& sync_token) override { | 71 void WaitSyncToken(const gpu::SyncToken& sync_token) override { |
68 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); | 72 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); |
69 } | 73 } |
70 | 74 |
71 private: | 75 private: |
72 gpu::gles2::GLES2Interface* gl_; | 76 gpu::gles2::GLES2Interface* gl_; |
73 | 77 |
74 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncTokenClientImpl); | 78 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncTokenClientImpl); |
75 }; | 79 }; |
76 | 80 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 } | 581 } |
578 | 582 |
579 void SkCanvasVideoRenderer::ResetCache() { | 583 void SkCanvasVideoRenderer::ResetCache() { |
580 DCHECK(thread_checker_.CalledOnValidThread()); | 584 DCHECK(thread_checker_.CalledOnValidThread()); |
581 // Clear cached values. | 585 // Clear cached values. |
582 last_image_ = nullptr; | 586 last_image_ = nullptr; |
583 last_timestamp_ = kNoTimestamp(); | 587 last_timestamp_ = kNoTimestamp(); |
584 } | 588 } |
585 | 589 |
586 } // namespace media | 590 } // namespace media |
OLD | NEW |