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 "content/common/gpu/media/rendering_helper.h" | 5 #include "content/common/gpu/media/rendering_helper.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 glBindTexture(texture_target, 0); | 658 glBindTexture(texture_target, 0); |
659 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); | 659 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); |
660 } | 660 } |
661 | 661 |
662 void RenderingHelper::DeleteTexture(uint32_t texture_id) { | 662 void RenderingHelper::DeleteTexture(uint32_t texture_id) { |
663 CHECK_EQ(base::MessageLoop::current(), message_loop_); | 663 CHECK_EQ(base::MessageLoop::current(), message_loop_); |
664 glDeleteTextures(1, &texture_id); | 664 glDeleteTextures(1, &texture_id); |
665 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); | 665 CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR); |
666 } | 666 } |
667 | 667 |
668 scoped_refptr<gfx::GLContext> RenderingHelper::GetGLContext() { | 668 gfx::GLContext* RenderingHelper::GetGLContext() { |
669 return gl_context_; | 669 return gl_context_.get(); |
670 } | |
671 | |
672 void* RenderingHelper::GetGLContextHandle() { | |
673 return gl_context_->GetHandle(); | |
674 } | 670 } |
675 | 671 |
676 void* RenderingHelper::GetGLDisplay() { | 672 void* RenderingHelper::GetGLDisplay() { |
677 return gl_surface_->GetDisplay(); | 673 return gl_surface_->GetDisplay(); |
678 } | 674 } |
679 | 675 |
680 void RenderingHelper::Clear() { | 676 void RenderingHelper::Clear() { |
681 videos_.clear(); | 677 videos_.clear(); |
682 message_loop_ = NULL; | 678 message_loop_ = NULL; |
683 gl_context_ = NULL; | 679 gl_context_ = NULL; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 // When the rendering falls behind, drops frames. | 885 // When the rendering falls behind, drops frames. |
890 while (scheduled_render_time_ < target) { | 886 while (scheduled_render_time_ < target) { |
891 scheduled_render_time_ += frame_duration_; | 887 scheduled_render_time_ += frame_duration_; |
892 DropOneFrameForAllVideos(); | 888 DropOneFrameForAllVideos(); |
893 } | 889 } |
894 | 890 |
895 message_loop_->PostDelayedTask( | 891 message_loop_->PostDelayedTask( |
896 FROM_HERE, render_task_.callback(), target - now); | 892 FROM_HERE, render_task_.callback(), target - now); |
897 } | 893 } |
898 } // namespace content | 894 } // namespace content |
OLD | NEW |