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 void GenerateSyncToken(gpu::SyncToken* sync_token) override { | 66 uint32 InsertSyncPoint() override { return gl_->InsertSyncPointCHROMIUM(); } |
67 const uint64_t fence_sync = gl_->InsertFenceSyncCHROMIUM(); | |
68 gl_->ShallowFlushCHROMIUM(); | |
69 gl_->GenSyncTokenCHROMIUM(fence_sync, sync_token->GetData()); | |
70 } | |
71 void WaitSyncToken(const gpu::SyncToken& sync_token) override { | 67 void WaitSyncToken(const gpu::SyncToken& sync_token) override { |
72 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); | 68 gl_->WaitSyncTokenCHROMIUM(sync_token.GetConstData()); |
73 } | 69 } |
74 | 70 |
75 private: | 71 private: |
76 gpu::gles2::GLES2Interface* gl_; | 72 gpu::gles2::GLES2Interface* gl_; |
77 | 73 |
78 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncTokenClientImpl); | 74 DISALLOW_IMPLICIT_CONSTRUCTORS(SyncTokenClientImpl); |
79 }; | 75 }; |
80 | 76 |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 577 } |
582 | 578 |
583 void SkCanvasVideoRenderer::ResetCache() { | 579 void SkCanvasVideoRenderer::ResetCache() { |
584 DCHECK(thread_checker_.CalledOnValidThread()); | 580 DCHECK(thread_checker_.CalledOnValidThread()); |
585 // Clear cached values. | 581 // Clear cached values. |
586 last_image_ = nullptr; | 582 last_image_ = nullptr; |
587 last_timestamp_ = kNoTimestamp(); | 583 last_timestamp_ = kNoTimestamp(); |
588 } | 584 } |
589 | 585 |
590 } // namespace media | 586 } // namespace media |
OLD | NEW |