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

Side by Side Diff: media/renderers/skcanvas_video_renderer.cc

Issue 1429213002: Converted video frame and image callbacks to use new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shallow flush before image creation Created 5 years, 1 month 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
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 "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
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_->Flush();
piman 2015/11/05 00:04:36 ShallowFlushCHROMIUM
David Yen 2015/11/05 00:34:27 Done.
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
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
OLDNEW
« gpu/command_buffer/service/sync_point_manager.h ('K') | « media/base/video_frame_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698