| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "cc/layers/video_frame_provider.h" | 6 #include "cc/layers/video_frame_provider.h" |
| 7 #include "media/base/video_frame.h" | 7 #include "media/base/video_frame.h" |
| 8 #include "media/blink/video_frame_compositor.h" | 8 #include "media/blink/video_frame_compositor.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 VideoFrameCompositor* compositor() { return compositor_.get(); } | 33 VideoFrameCompositor* compositor() { return compositor_.get(); } |
| 34 int did_receive_frame_count() { return did_receive_frame_count_; } | 34 int did_receive_frame_count() { return did_receive_frame_count_; } |
| 35 int natural_size_changed_count() { return natural_size_changed_count_; } | 35 int natural_size_changed_count() { return natural_size_changed_count_; } |
| 36 gfx::Size natural_size() { return natural_size_; } | 36 gfx::Size natural_size() { return natural_size_; } |
| 37 | 37 |
| 38 int opacity_changed_count() { return opacity_changed_count_; } | 38 int opacity_changed_count() { return opacity_changed_count_; } |
| 39 bool opaque() { return opaque_; } | 39 bool opaque() { return opaque_; } |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // cc::VideoFrameProvider::Client implementation. | 42 // cc::VideoFrameProvider::Client implementation. |
| 43 virtual void StopUsingProvider() OVERRIDE {} | 43 virtual void StopUsingProvider() override {} |
| 44 virtual void DidReceiveFrame() OVERRIDE { | 44 virtual void DidReceiveFrame() override { |
| 45 ++did_receive_frame_count_; | 45 ++did_receive_frame_count_; |
| 46 } | 46 } |
| 47 virtual void DidUpdateMatrix(const float* matrix) OVERRIDE {} | 47 virtual void DidUpdateMatrix(const float* matrix) override {} |
| 48 | 48 |
| 49 void NaturalSizeChanged(gfx::Size natural_size) { | 49 void NaturalSizeChanged(gfx::Size natural_size) { |
| 50 ++natural_size_changed_count_; | 50 ++natural_size_changed_count_; |
| 51 natural_size_ = natural_size; | 51 natural_size_ = natural_size; |
| 52 } | 52 } |
| 53 | 53 |
| 54 void OpacityChanged(bool opaque) { | 54 void OpacityChanged(bool opaque) { |
| 55 ++opacity_changed_count_; | 55 ++opacity_changed_count_; |
| 56 opaque_ = opaque; | 56 opaque_ = opaque; |
| 57 } | 57 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 EXPECT_TRUE(opaque()); | 151 EXPECT_TRUE(opaque()); |
| 152 EXPECT_EQ(2, opacity_changed_count()); | 152 EXPECT_EQ(2, opacity_changed_count()); |
| 153 | 153 |
| 154 // Callback shouldn't be first subsequent times with same opaqueness. | 154 // Callback shouldn't be first subsequent times with same opaqueness. |
| 155 compositor()->UpdateCurrentFrame(opaque_frame); | 155 compositor()->UpdateCurrentFrame(opaque_frame); |
| 156 EXPECT_TRUE(opaque()); | 156 EXPECT_TRUE(opaque()); |
| 157 EXPECT_EQ(2, opacity_changed_count()); | 157 EXPECT_EQ(2, opacity_changed_count()); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace media | 160 } // namespace media |
| OLD | NEW |