| OLD | NEW |
| 1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn | 1 diff --git a/cc/BUILD.gn b/cc/BUILD.gn |
| 2 index c744c5b..16a1589 100644 | 2 index c744c5b..16a1589 100644 |
| 3 --- a/cc/BUILD.gn | 3 --- a/cc/BUILD.gn |
| 4 +++ b/cc/BUILD.gn | 4 +++ b/cc/BUILD.gn |
| 5 @@ -212,13 +212,6 @@ component("cc") { | 5 @@ -212,13 +212,6 @@ component("cc") { |
| 6 "layers/ui_resource_layer.h", | 6 "layers/ui_resource_layer.h", |
| 7 "layers/ui_resource_layer_impl.cc", | 7 "layers/ui_resource_layer_impl.cc", |
| 8 "layers/ui_resource_layer_impl.h", | 8 "layers/ui_resource_layer_impl.h", |
| 9 - "layers/video_frame_provider.h", | 9 - "layers/video_frame_provider.h", |
| 10 - "layers/video_frame_provider_client_impl.cc", | 10 - "layers/video_frame_provider_client_impl.cc", |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 - scoped_refptr<VideoFrame> color_video_frame_; | 864 - scoped_refptr<VideoFrame> color_video_frame_; |
| 865 - scoped_refptr<VideoFrame> hw_video_frame_; | 865 - scoped_refptr<VideoFrame> hw_video_frame_; |
| 866 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; | 866 - scoped_refptr<VideoFrame> scaled_hw_video_frame_; |
| 867 - | 867 - |
| 868 - FakeVideoFrameProvider color_frame_provider_; | 868 - FakeVideoFrameProvider color_frame_provider_; |
| 869 - FakeVideoFrameProvider hw_frame_provider_; | 869 - FakeVideoFrameProvider hw_frame_provider_; |
| 870 - FakeVideoFrameProvider scaled_hw_frame_provider_; | 870 - FakeVideoFrameProvider scaled_hw_frame_provider_; |
| 871 }; | 871 }; |
| 872 | 872 |
| 873 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); | 873 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); |
| 874 diff --git a/mojo/tools/roll/cc_strip_video.patch b/mojo/tools/roll/cc_strip_vid
eo.patch | |
| 875 index 90bb220..c7cb034 100644 | |
| 876 --- a/mojo/tools/roll/cc_strip_video.patch | |
| 877 +++ b/mojo/tools/roll/cc_strip_video.patch | |
| 878 @@ -1,885 +0,0 @@ | |
| 879 -diff --git a/cc/BUILD.gn b/cc/BUILD.gn | |
| 880 -index a296bb0..ab3aab4 100644 | |
| 881 ---- a/cc/BUILD.gn | |
| 882 -+++ b/cc/BUILD.gn | |
| 883 -@@ -212,13 +212,6 @@ component("cc") { | |
| 884 - "layers/ui_resource_layer.h", | |
| 885 - "layers/ui_resource_layer_impl.cc", | |
| 886 - "layers/ui_resource_layer_impl.h", | |
| 887 -- "layers/video_frame_provider.h", | |
| 888 -- "layers/video_frame_provider_client_impl.cc", | |
| 889 -- "layers/video_frame_provider_client_impl.h", | |
| 890 -- "layers/video_layer.cc", | |
| 891 -- "layers/video_layer.h", | |
| 892 -- "layers/video_layer_impl.cc", | |
| 893 -- "layers/video_layer_impl.h", | |
| 894 - "output/begin_frame_args.cc", | |
| 895 - "output/begin_frame_args.h", | |
| 896 - "output/bsp_tree.cc", | |
| 897 -@@ -429,8 +422,6 @@ component("cc") { | |
| 898 - "resources/ui_resource_client.h", | |
| 899 - "resources/ui_resource_request.cc", | |
| 900 - "resources/ui_resource_request.h", | |
| 901 -- "resources/video_resource_updater.cc", | |
| 902 -- "resources/video_resource_updater.h", | |
| 903 - "resources/zero_copy_raster_worker_pool.cc", | |
| 904 - "resources/zero_copy_raster_worker_pool.h", | |
| 905 - "scheduler/begin_frame_source.cc", | |
| 906 -@@ -492,7 +483,6 @@ component("cc") { | |
| 907 - "//gpu", | |
| 908 - "//gpu/command_buffer/client:gles2_interface", | |
| 909 - "//gpu/command_buffer/client:gpu_memory_buffer_manager", | |
| 910 -- "//media", | |
| 911 - "//ui/events:events_base", | |
| 912 - "//ui/gfx", | |
| 913 - "//ui/gfx/geometry", | |
| 914 -@@ -563,8 +553,6 @@ source_set("test_support") { | |
| 915 - "test/fake_tile_manager_client.h", | |
| 916 - "test/fake_ui_resource_layer_tree_host_impl.cc", | |
| 917 - "test/fake_ui_resource_layer_tree_host_impl.h", | |
| 918 -- "test/fake_video_frame_provider.cc", | |
| 919 -- "test/fake_video_frame_provider.h", | |
| 920 - "test/geometry_test_utils.cc", | |
| 921 - "test/geometry_test_utils.h", | |
| 922 - "test/test_in_process_context_provider.cc", | |
| 923 -@@ -717,7 +705,6 @@ test("cc_unittests") { | |
| 924 - "layers/tiled_layer_unittest.cc", | |
| 925 - "layers/ui_resource_layer_impl_unittest.cc", | |
| 926 - "layers/ui_resource_layer_unittest.cc", | |
| 927 -- "layers/video_layer_impl_unittest.cc", | |
| 928 - "output/begin_frame_args_unittest.cc", | |
| 929 - "output/delegating_renderer_unittest.cc", | |
| 930 - "output/filter_operations_unittest.cc", | |
| 931 -@@ -747,7 +734,6 @@ test("cc_unittests") { | |
| 932 - "resources/texture_uploader_unittest.cc", | |
| 933 - "resources/tile_manager_unittest.cc", | |
| 934 - "resources/tile_priority_unittest.cc", | |
| 935 -- "resources/video_resource_updater_unittest.cc", | |
| 936 - "scheduler/begin_frame_source_unittest.cc", | |
| 937 - "scheduler/delay_based_time_source_unittest.cc", | |
| 938 - "scheduler/scheduler_state_machine_unittest.cc", | |
| 939 -@@ -776,7 +762,6 @@ test("cc_unittests") { | |
| 940 - "trees/layer_tree_host_unittest_picture.cc", | |
| 941 - "trees/layer_tree_host_unittest_proxy.cc", | |
| 942 - "trees/layer_tree_host_unittest_scroll.cc", | |
| 943 -- "trees/layer_tree_host_unittest_video.cc", | |
| 944 - "trees/layer_tree_impl_unittest.cc", | |
| 945 - "trees/occlusion_tracker_unittest.cc", | |
| 946 - "trees/occlusion_unittest.cc", | |
| 947 -@@ -803,7 +788,6 @@ test("cc_unittests") { | |
| 948 - "//gpu:test_support", | |
| 949 - "//gpu/command_buffer/client:gles2_interface", | |
| 950 - "//gpu/command_buffer/common:gles2_utils", | |
| 951 -- "//media", | |
| 952 - "//testing/gmock", | |
| 953 - "//testing/gtest", | |
| 954 - "//ui/events:events_base", | |
| 955 -@@ -835,7 +819,6 @@ test("cc_perftests") { | |
| 956 - "//gpu", | |
| 957 - "//gpu:test_support", | |
| 958 - "//gpu/command_buffer/common:gles2_utils", | |
| 959 -- "//media", | |
| 960 - "//skia", | |
| 961 - "//testing/gmock", | |
| 962 - "//testing/gtest", | |
| 963 -diff --git a/cc/layers/video_frame_provider.h b/cc/layers/video_frame_provider.
h | |
| 964 -deleted file mode 100644 | |
| 965 -index 784d951..0000000 | |
| 966 ---- a/cc/layers/video_frame_provider.h | |
| 967 -+++ /dev/null | |
| 968 -@@ -1,63 +0,0 @@ | |
| 969 --// Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 970 --// Use of this source code is governed by a BSD-style license that can be | |
| 971 --// found in the LICENSE file. | |
| 972 -- | |
| 973 --#ifndef CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | |
| 974 --#define CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | |
| 975 -- | |
| 976 --#include "base/memory/ref_counted.h" | |
| 977 -- | |
| 978 --namespace media { | |
| 979 --class VideoFrame; | |
| 980 --} | |
| 981 -- | |
| 982 --namespace cc { | |
| 983 -- | |
| 984 --// Threading notes: This class may be used in a multi threaded manner. | |
| 985 --// Specifically, the implementation may call GetCurrentFrame() or | |
| 986 --// PutCurrentFrame() from the compositor thread. If so, the caller is | |
| 987 --// responsible for making sure Client::DidReceiveFrame() and | |
| 988 --// Client::DidUpdateMatrix() are only called from this same thread. | |
| 989 --class VideoFrameProvider { | |
| 990 -- public: | |
| 991 -- virtual ~VideoFrameProvider() {} | |
| 992 -- | |
| 993 -- class Client { | |
| 994 -- public: | |
| 995 -- // Provider will call this method to tell the client to stop using it. | |
| 996 -- // StopUsingProvider() may be called from any thread. The client should | |
| 997 -- // block until it has PutCurrentFrame() any outstanding frames. | |
| 998 -- virtual void StopUsingProvider() = 0; | |
| 999 -- | |
| 1000 -- // Notifies the provider's client that a call to GetCurrentFrame() will | |
| 1001 -- // return new data. | |
| 1002 -- virtual void DidReceiveFrame() = 0; | |
| 1003 -- | |
| 1004 -- // Notifies the provider's client of a new UV transform matrix to be used. | |
| 1005 -- virtual void DidUpdateMatrix(const float* matrix) = 0; | |
| 1006 -- | |
| 1007 -- protected: | |
| 1008 -- virtual ~Client() {} | |
| 1009 -- }; | |
| 1010 -- | |
| 1011 -- // May be called from any thread, but there must be some external guarantee | |
| 1012 -- // that the provider is not destroyed before this call returns. | |
| 1013 -- virtual void SetVideoFrameProviderClient(Client* client) = 0; | |
| 1014 -- | |
| 1015 -- // This function places a lock on the current frame and returns a pointer to | |
| 1016 -- // it. Calls to this method should always be followed with a call to | |
| 1017 -- // PutCurrentFrame(). | |
| 1018 -- // Only the current provider client should call this function. | |
| 1019 -- virtual scoped_refptr<media::VideoFrame> GetCurrentFrame() = 0; | |
| 1020 -- | |
| 1021 -- // This function releases the lock on the video frame. It should always be | |
| 1022 -- // called after GetCurrentFrame(). Frames passed into this method | |
| 1023 -- // should no longer be referenced after the call is made. Only the current | |
| 1024 -- // provider client should call this function. | |
| 1025 -- virtual void PutCurrentFrame( | |
| 1026 -- const scoped_refptr<media::VideoFrame>& frame) = 0; | |
| 1027 --}; | |
| 1028 -- | |
| 1029 --} // namespace cc | |
| 1030 -- | |
| 1031 --#endif // CC_LAYERS_VIDEO_FRAME_PROVIDER_H_ | |
| 1032 -diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_fr
ame_provider_client_impl.cc | |
| 1033 -deleted file mode 100644 | |
| 1034 -index 50333c1..0000000 | |
| 1035 ---- a/cc/layers/video_frame_provider_client_impl.cc | |
| 1036 -+++ /dev/null | |
| 1037 -@@ -1,95 +0,0 @@ | |
| 1038 --// Copyright 2013 The Chromium Authors. All rights reserved. | |
| 1039 --// Use of this source code is governed by a BSD-style license that can be | |
| 1040 --// found in the LICENSE file. | |
| 1041 -- | |
| 1042 --#include "cc/layers/video_frame_provider_client_impl.h" | |
| 1043 -- | |
| 1044 --#include "base/debug/trace_event.h" | |
| 1045 --#include "cc/base/math_util.h" | |
| 1046 --#include "cc/layers/video_layer_impl.h" | |
| 1047 --#include "media/base/video_frame.h" | |
| 1048 -- | |
| 1049 --namespace cc { | |
| 1050 -- | |
| 1051 --// static | |
| 1052 --scoped_refptr<VideoFrameProviderClientImpl> | |
| 1053 -- VideoFrameProviderClientImpl::Create( | |
| 1054 -- VideoFrameProvider* provider) { | |
| 1055 -- return make_scoped_refptr( | |
| 1056 -- new VideoFrameProviderClientImpl(provider)); | |
| 1057 --} | |
| 1058 -- | |
| 1059 --VideoFrameProviderClientImpl::~VideoFrameProviderClientImpl() {} | |
| 1060 -- | |
| 1061 --VideoFrameProviderClientImpl::VideoFrameProviderClientImpl( | |
| 1062 -- VideoFrameProvider* provider) | |
| 1063 -- : active_video_layer_(nullptr), provider_(provider) { | |
| 1064 -- // This only happens during a commit on the compositor thread while the main | |
| 1065 -- // thread is blocked. That makes this a thread-safe call to set the video | |
| 1066 -- // frame provider client that does not require a lock. The same is true of | |
| 1067 -- // the call to Stop(). | |
| 1068 -- provider_->SetVideoFrameProviderClient(this); | |
| 1069 -- | |
| 1070 -- // This matrix is the default transformation for stream textures, and flips | |
| 1071 -- // on the Y axis. | |
| 1072 -- stream_texture_matrix_ = gfx::Transform( | |
| 1073 -- 1.0, 0.0, 0.0, 0.0, | |
| 1074 -- 0.0, -1.0, 0.0, 1.0, | |
| 1075 -- 0.0, 0.0, 1.0, 0.0, | |
| 1076 -- 0.0, 0.0, 0.0, 1.0); | |
| 1077 --} | |
| 1078 -- | |
| 1079 --void VideoFrameProviderClientImpl::Stop() { | |
| 1080 -- if (!provider_) | |
| 1081 -- return; | |
| 1082 -- provider_->SetVideoFrameProviderClient(nullptr); | |
| 1083 -- provider_ = nullptr; | |
| 1084 --} | |
| 1085 -- | |
| 1086 --scoped_refptr<media::VideoFrame> | |
| 1087 --VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() { | |
| 1088 -- provider_lock_.Acquire(); // Balanced by call to ReleaseLock(). | |
| 1089 -- if (!provider_) | |
| 1090 -- return nullptr; | |
| 1091 -- | |
| 1092 -- return provider_->GetCurrentFrame(); | |
| 1093 --} | |
| 1094 -- | |
| 1095 --void VideoFrameProviderClientImpl::PutCurrentFrame( | |
| 1096 -- const scoped_refptr<media::VideoFrame>& frame) { | |
| 1097 -- provider_lock_.AssertAcquired(); | |
| 1098 -- provider_->PutCurrentFrame(frame); | |
| 1099 --} | |
| 1100 -- | |
| 1101 --void VideoFrameProviderClientImpl::ReleaseLock() { | |
| 1102 -- provider_lock_.AssertAcquired(); | |
| 1103 -- provider_lock_.Release(); | |
| 1104 --} | |
| 1105 -- | |
| 1106 --void VideoFrameProviderClientImpl::StopUsingProvider() { | |
| 1107 -- // Block the provider from shutting down until this client is done | |
| 1108 -- // using the frame. | |
| 1109 -- base::AutoLock locker(provider_lock_); | |
| 1110 -- provider_ = nullptr; | |
| 1111 --} | |
| 1112 -- | |
| 1113 --void VideoFrameProviderClientImpl::DidReceiveFrame() { | |
| 1114 -- TRACE_EVENT1("cc", | |
| 1115 -- "VideoFrameProviderClientImpl::DidReceiveFrame", | |
| 1116 -- "active_video_layer", | |
| 1117 -- !!active_video_layer_); | |
| 1118 -- if (active_video_layer_) | |
| 1119 -- active_video_layer_->SetNeedsRedraw(); | |
| 1120 --} | |
| 1121 -- | |
| 1122 --void VideoFrameProviderClientImpl::DidUpdateMatrix(const float* matrix) { | |
| 1123 -- stream_texture_matrix_ = gfx::Transform( | |
| 1124 -- matrix[0], matrix[4], matrix[8], matrix[12], | |
| 1125 -- matrix[1], matrix[5], matrix[9], matrix[13], | |
| 1126 -- matrix[2], matrix[6], matrix[10], matrix[14], | |
| 1127 -- matrix[3], matrix[7], matrix[11], matrix[15]); | |
| 1128 -- if (active_video_layer_) | |
| 1129 -- active_video_layer_->SetNeedsRedraw(); | |
| 1130 --} | |
| 1131 -- | |
| 1132 --} // namespace cc | |
| 1133 -diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc | |
| 1134 -index 75dcfe8..cb6189e 100644 | |
| 1135 ---- a/cc/output/gl_renderer.cc | |
| 1136 -+++ b/cc/output/gl_renderer.cc | |
| 1137 -@@ -13,7 +13,6 @@ | |
| 1138 - #include "base/debug/trace_event.h" | |
| 1139 - #include "base/logging.h" | |
| 1140 - #include "cc/base/math_util.h" | |
| 1141 --#include "cc/layers/video_layer_impl.h" | |
| 1142 - #include "cc/output/compositor_frame.h" | |
| 1143 - #include "cc/output/compositor_frame_metadata.h" | |
| 1144 - #include "cc/output/context_provider.h" | |
| 1145 -diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc | |
| 1146 -index 0c2bc3d..d112ed1 100644 | |
| 1147 ---- a/cc/output/renderer_pixeltest.cc | |
| 1148 -+++ b/cc/output/renderer_pixeltest.cc | |
| 1149 -@@ -12,7 +12,6 @@ | |
| 1150 - #include "cc/test/fake_picture_pile_impl.h" | |
| 1151 - #include "cc/test/pixel_test.h" | |
| 1152 - #include "gpu/command_buffer/client/gles2_interface.h" | |
| 1153 --#include "media/base/video_frame.h" | |
| 1154 - #include "third_party/skia/include/core/SkColorPriv.h" | |
| 1155 - #include "third_party/skia/include/core/SkImageFilter.h" | |
| 1156 - #include "third_party/skia/include/core/SkMatrix.h" | |
| 1157 -@@ -385,346 +384,6 @@ TEST_F(GLRendererPixelTest, NonPremultipliedTextureWithBa
ckground) { | |
| 1158 - FuzzyPixelOffByOneComparator(true))); | |
| 1159 - } | |
| 1160 - | |
| 1161 --class VideoGLRendererPixelTest : public GLRendererPixelTest { | |
| 1162 -- protected: | |
| 1163 -- void CreateTestYUVVideoDrawQuad_Striped(const SharedQuadState* shared_state, | |
| 1164 -- media::VideoFrame::Format format, | |
| 1165 -- bool is_transparent, | |
| 1166 -- const gfx::RectF& tex_coord_rect, | |
| 1167 -- RenderPass* render_pass) { | |
| 1168 -- const gfx::Rect rect(this->device_viewport_size_); | |
| 1169 -- | |
| 1170 -- scoped_refptr<media::VideoFrame> video_frame = | |
| 1171 -- media::VideoFrame::CreateFrame( | |
| 1172 -- format, rect.size(), rect, rect.size(), base::TimeDelta()); | |
| 1173 -- | |
| 1174 -- // YUV values representing a striped pattern, for validating texture | |
| 1175 -- // coordinates for sampling. | |
| 1176 -- uint8_t y_value = 0; | |
| 1177 -- uint8_t u_value = 0; | |
| 1178 -- uint8_t v_value = 0; | |
| 1179 -- for (int i = 0; i < video_frame->rows(media::VideoFrame::kYPlane); ++i) { | |
| 1180 -- uint8_t* y_row = video_frame->data(media::VideoFrame::kYPlane) + | |
| 1181 -- video_frame->stride(media::VideoFrame::kYPlane) * i; | |
| 1182 -- for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kYPlane); | |
| 1183 -- ++j) { | |
| 1184 -- y_row[j] = (y_value += 1); | |
| 1185 -- } | |
| 1186 -- } | |
| 1187 -- for (int i = 0; i < video_frame->rows(media::VideoFrame::kUPlane); ++i) { | |
| 1188 -- uint8_t* u_row = video_frame->data(media::VideoFrame::kUPlane) + | |
| 1189 -- video_frame->stride(media::VideoFrame::kUPlane) * i; | |
| 1190 -- uint8_t* v_row = video_frame->data(media::VideoFrame::kVPlane) + | |
| 1191 -- video_frame->stride(media::VideoFrame::kVPlane) * i; | |
| 1192 -- for (int j = 0; j < video_frame->row_bytes(media::VideoFrame::kUPlane); | |
| 1193 -- ++j) { | |
| 1194 -- u_row[j] = (u_value += 3); | |
| 1195 -- v_row[j] = (v_value += 5); | |
| 1196 -- } | |
| 1197 -- } | |
| 1198 -- CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
| 1199 -- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass
); | |
| 1200 -- } | |
| 1201 -- | |
| 1202 -- void CreateTestYUVVideoDrawQuad_Solid(const SharedQuadState* shared_state, | |
| 1203 -- media::VideoFrame::Format format, | |
| 1204 -- bool is_transparent, | |
| 1205 -- const gfx::RectF& tex_coord_rect, | |
| 1206 -- uint8 y, | |
| 1207 -- uint8 u, | |
| 1208 -- uint8 v, | |
| 1209 -- RenderPass* render_pass) { | |
| 1210 -- const gfx::Rect rect(this->device_viewport_size_); | |
| 1211 -- | |
| 1212 -- scoped_refptr<media::VideoFrame> video_frame = | |
| 1213 -- media::VideoFrame::CreateFrame( | |
| 1214 -- format, rect.size(), rect, rect.size(), base::TimeDelta()); | |
| 1215 -- | |
| 1216 -- // YUV values of a solid, constant, color. Useful for testing that color | |
| 1217 -- // space/color range are being handled properly. | |
| 1218 -- memset(video_frame->data(media::VideoFrame::kYPlane), | |
| 1219 -- y, | |
| 1220 -- video_frame->stride(media::VideoFrame::kYPlane) * | |
| 1221 -- video_frame->rows(media::VideoFrame::kYPlane)); | |
| 1222 -- memset(video_frame->data(media::VideoFrame::kUPlane), | |
| 1223 -- u, | |
| 1224 -- video_frame->stride(media::VideoFrame::kUPlane) * | |
| 1225 -- video_frame->rows(media::VideoFrame::kUPlane)); | |
| 1226 -- memset(video_frame->data(media::VideoFrame::kVPlane), | |
| 1227 -- v, | |
| 1228 -- video_frame->stride(media::VideoFrame::kVPlane) * | |
| 1229 -- video_frame->rows(media::VideoFrame::kVPlane)); | |
| 1230 -- | |
| 1231 -- CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
| 1232 -- shared_state, video_frame, is_transparent, tex_coord_rect, render_pass
); | |
| 1233 -- } | |
| 1234 -- | |
| 1235 -- void CreateTestYUVVideoDrawQuad_FromVideoFrame( | |
| 1236 -- const SharedQuadState* shared_state, | |
| 1237 -- scoped_refptr<media::VideoFrame> video_frame, | |
| 1238 -- bool is_transparent, | |
| 1239 -- const gfx::RectF& tex_coord_rect, | |
| 1240 -- RenderPass* render_pass) { | |
| 1241 -- const bool with_alpha = (video_frame->format() == media::VideoFrame::YV12A
); | |
| 1242 -- const YUVVideoDrawQuad::ColorSpace color_space = | |
| 1243 -- (video_frame->format() == media::VideoFrame::YV12J | |
| 1244 -- ? YUVVideoDrawQuad::REC_601_JPEG | |
| 1245 -- : YUVVideoDrawQuad::REC_601); | |
| 1246 -- const gfx::Rect rect(this->device_viewport_size_); | |
| 1247 -- const gfx::Rect opaque_rect(0, 0, 0, 0); | |
| 1248 -- | |
| 1249 -- if (with_alpha) | |
| 1250 -- memset(video_frame->data(media::VideoFrame::kAPlane), | |
| 1251 -- is_transparent ? 0 : 128, | |
| 1252 -- video_frame->stride(media::VideoFrame::kAPlane) * | |
| 1253 -- video_frame->rows(media::VideoFrame::kAPlane)); | |
| 1254 -- | |
| 1255 -- VideoFrameExternalResources resources = | |
| 1256 -- video_resource_updater_->CreateExternalResourcesFromVideoFrame( | |
| 1257 -- video_frame); | |
| 1258 -- | |
| 1259 -- EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); | |
| 1260 -- EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()), | |
| 1261 -- resources.mailboxes.size()); | |
| 1262 -- EXPECT_EQ(media::VideoFrame::NumPlanes(video_frame->format()), | |
| 1263 -- resources.release_callbacks.size()); | |
| 1264 -- | |
| 1265 -- ResourceProvider::ResourceId y_resource = | |
| 1266 -- resource_provider_->CreateResourceFromTextureMailbox( | |
| 1267 -- resources.mailboxes[media::VideoFrame::kYPlane], | |
| 1268 -- SingleReleaseCallbackImpl::Create( | |
| 1269 -- resources.release_callbacks[media::VideoFrame::kYPlane])); | |
| 1270 -- ResourceProvider::ResourceId u_resource = | |
| 1271 -- resource_provider_->CreateResourceFromTextureMailbox( | |
| 1272 -- resources.mailboxes[media::VideoFrame::kUPlane], | |
| 1273 -- SingleReleaseCallbackImpl::Create( | |
| 1274 -- resources.release_callbacks[media::VideoFrame::kUPlane])); | |
| 1275 -- ResourceProvider::ResourceId v_resource = | |
| 1276 -- resource_provider_->CreateResourceFromTextureMailbox( | |
| 1277 -- resources.mailboxes[media::VideoFrame::kVPlane], | |
| 1278 -- SingleReleaseCallbackImpl::Create( | |
| 1279 -- resources.release_callbacks[media::VideoFrame::kVPlane])); | |
| 1280 -- ResourceProvider::ResourceId a_resource = 0; | |
| 1281 -- if (with_alpha) { | |
| 1282 -- a_resource = resource_provider_->CreateResourceFromTextureMailbox( | |
| 1283 -- resources.mailboxes[media::VideoFrame::kAPlane], | |
| 1284 -- SingleReleaseCallbackImpl::Create( | |
| 1285 -- resources.release_callbacks[media::VideoFrame::kAPlane])); | |
| 1286 -- } | |
| 1287 -- | |
| 1288 -- YUVVideoDrawQuad* yuv_quad = | |
| 1289 -- render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | |
| 1290 -- yuv_quad->SetNew(shared_state, | |
| 1291 -- rect, | |
| 1292 -- opaque_rect, | |
| 1293 -- rect, | |
| 1294 -- tex_coord_rect, | |
| 1295 -- y_resource, | |
| 1296 -- u_resource, | |
| 1297 -- v_resource, | |
| 1298 -- a_resource, | |
| 1299 -- color_space); | |
| 1300 -- } | |
| 1301 -- | |
| 1302 -- void SetUp() override { | |
| 1303 -- GLRendererPixelTest::SetUp(); | |
| 1304 -- video_resource_updater_.reset(new VideoResourceUpdater( | |
| 1305 -- output_surface_->context_provider(), resource_provider_.get())); | |
| 1306 -- } | |
| 1307 -- | |
| 1308 -- private: | |
| 1309 -- scoped_ptr<VideoResourceUpdater> video_resource_updater_; | |
| 1310 --}; | |
| 1311 -- | |
| 1312 --TEST_F(VideoGLRendererPixelTest, SimpleYUVRect) { | |
| 1313 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1314 -- | |
| 1315 -- RenderPassId id(1, 1); | |
| 1316 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1317 -- | |
| 1318 -- SharedQuadState* shared_state = | |
| 1319 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1320 -- | |
| 1321 -- CreateTestYUVVideoDrawQuad_Striped(shared_state, | |
| 1322 -- media::VideoFrame::YV12, | |
| 1323 -- false, | |
| 1324 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1325 -- pass.get()); | |
| 1326 -- | |
| 1327 -- RenderPassList pass_list; | |
| 1328 -- pass_list.push_back(pass.Pass()); | |
| 1329 -- | |
| 1330 -- EXPECT_TRUE( | |
| 1331 -- this->RunPixelTest(&pass_list, | |
| 1332 -- base::FilePath(FILE_PATH_LITERAL("yuv_stripes.png")), | |
| 1333 -- FuzzyPixelOffByOneComparator(true))); | |
| 1334 --} | |
| 1335 -- | |
| 1336 --TEST_F(VideoGLRendererPixelTest, OffsetYUVRect) { | |
| 1337 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1338 -- | |
| 1339 -- RenderPassId id(1, 1); | |
| 1340 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1341 -- | |
| 1342 -- SharedQuadState* shared_state = | |
| 1343 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1344 -- | |
| 1345 -- // Intentionally sets frame format to I420 for testing coverage. | |
| 1346 -- CreateTestYUVVideoDrawQuad_Striped(shared_state, | |
| 1347 -- media::VideoFrame::I420, | |
| 1348 -- false, | |
| 1349 -- gfx::RectF(0.125f, 0.25f, 0.75f, 0.5f), | |
| 1350 -- pass.get()); | |
| 1351 -- | |
| 1352 -- RenderPassList pass_list; | |
| 1353 -- pass_list.push_back(pass.Pass()); | |
| 1354 -- | |
| 1355 -- EXPECT_TRUE(this->RunPixelTest( | |
| 1356 -- &pass_list, | |
| 1357 -- base::FilePath(FILE_PATH_LITERAL("yuv_stripes_offset.png")), | |
| 1358 -- FuzzyPixelOffByOneComparator(true))); | |
| 1359 --} | |
| 1360 -- | |
| 1361 --TEST_F(VideoGLRendererPixelTest, SimpleYUVRectBlack) { | |
| 1362 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1363 -- | |
| 1364 -- RenderPassId id(1, 1); | |
| 1365 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1366 -- | |
| 1367 -- SharedQuadState* shared_state = | |
| 1368 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1369 -- | |
| 1370 -- // In MPEG color range YUV values of (15,128,128) should produce black. | |
| 1371 -- CreateTestYUVVideoDrawQuad_Solid(shared_state, | |
| 1372 -- media::VideoFrame::YV12, | |
| 1373 -- false, | |
| 1374 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1375 -- 15, | |
| 1376 -- 128, | |
| 1377 -- 128, | |
| 1378 -- pass.get()); | |
| 1379 -- | |
| 1380 -- RenderPassList pass_list; | |
| 1381 -- pass_list.push_back(pass.Pass()); | |
| 1382 -- | |
| 1383 -- // If we didn't get black out of the YUV values above, then we probably have
a | |
| 1384 -- // color range issue. | |
| 1385 -- EXPECT_TRUE(this->RunPixelTest(&pass_list, | |
| 1386 -- base::FilePath(FILE_PATH_LITERAL("black.png")
), | |
| 1387 -- FuzzyPixelOffByOneComparator(true))); | |
| 1388 --} | |
| 1389 -- | |
| 1390 --TEST_F(VideoGLRendererPixelTest, SimpleYUVJRect) { | |
| 1391 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1392 -- | |
| 1393 -- RenderPassId id(1, 1); | |
| 1394 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1395 -- | |
| 1396 -- SharedQuadState* shared_state = | |
| 1397 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1398 -- | |
| 1399 -- // YUV of (149,43,21) should be green (0,255,0) in RGB. | |
| 1400 -- CreateTestYUVVideoDrawQuad_Solid(shared_state, | |
| 1401 -- media::VideoFrame::YV12J, | |
| 1402 -- false, | |
| 1403 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1404 -- 149, | |
| 1405 -- 43, | |
| 1406 -- 21, | |
| 1407 -- pass.get()); | |
| 1408 -- | |
| 1409 -- RenderPassList pass_list; | |
| 1410 -- pass_list.push_back(pass.Pass()); | |
| 1411 -- | |
| 1412 -- EXPECT_TRUE(this->RunPixelTest(&pass_list, | |
| 1413 -- base::FilePath(FILE_PATH_LITERAL("green.png")
), | |
| 1414 -- FuzzyPixelOffByOneComparator(true))); | |
| 1415 --} | |
| 1416 -- | |
| 1417 --TEST_F(VideoGLRendererPixelTest, SimpleYUVJRectGrey) { | |
| 1418 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1419 -- | |
| 1420 -- RenderPassId id(1, 1); | |
| 1421 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1422 -- | |
| 1423 -- SharedQuadState* shared_state = | |
| 1424 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1425 -- | |
| 1426 -- // Dark grey in JPEG color range (in MPEG, this is black). | |
| 1427 -- CreateTestYUVVideoDrawQuad_Solid(shared_state, | |
| 1428 -- media::VideoFrame::YV12J, | |
| 1429 -- false, | |
| 1430 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1431 -- 15, | |
| 1432 -- 128, | |
| 1433 -- 128, | |
| 1434 -- pass.get()); | |
| 1435 -- | |
| 1436 -- RenderPassList pass_list; | |
| 1437 -- pass_list.push_back(pass.Pass()); | |
| 1438 -- | |
| 1439 -- EXPECT_TRUE( | |
| 1440 -- this->RunPixelTest(&pass_list, | |
| 1441 -- base::FilePath(FILE_PATH_LITERAL("dark_grey.png")), | |
| 1442 -- FuzzyPixelOffByOneComparator(true))); | |
| 1443 --} | |
| 1444 -- | |
| 1445 --TEST_F(VideoGLRendererPixelTest, SimpleYUVARect) { | |
| 1446 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1447 -- | |
| 1448 -- RenderPassId id(1, 1); | |
| 1449 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1450 -- | |
| 1451 -- SharedQuadState* shared_state = | |
| 1452 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1453 -- | |
| 1454 -- CreateTestYUVVideoDrawQuad_Striped(shared_state, | |
| 1455 -- media::VideoFrame::YV12A, | |
| 1456 -- false, | |
| 1457 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1458 -- pass.get()); | |
| 1459 -- | |
| 1460 -- SolidColorDrawQuad* color_quad = | |
| 1461 -- pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | |
| 1462 -- color_quad->SetNew(shared_state, rect, rect, SK_ColorWHITE, false); | |
| 1463 -- | |
| 1464 -- RenderPassList pass_list; | |
| 1465 -- pass_list.push_back(pass.Pass()); | |
| 1466 -- | |
| 1467 -- EXPECT_TRUE(this->RunPixelTest( | |
| 1468 -- &pass_list, | |
| 1469 -- base::FilePath(FILE_PATH_LITERAL("yuv_stripes_alpha.png")), | |
| 1470 -- FuzzyPixelOffByOneComparator(true))); | |
| 1471 --} | |
| 1472 -- | |
| 1473 --TEST_F(VideoGLRendererPixelTest, FullyTransparentYUVARect) { | |
| 1474 -- gfx::Rect rect(this->device_viewport_size_); | |
| 1475 -- | |
| 1476 -- RenderPassId id(1, 1); | |
| 1477 -- scoped_ptr<RenderPass> pass = CreateTestRootRenderPass(id, rect); | |
| 1478 -- | |
| 1479 -- SharedQuadState* shared_state = | |
| 1480 -- CreateTestSharedQuadState(gfx::Transform(), rect, pass.get()); | |
| 1481 -- | |
| 1482 -- CreateTestYUVVideoDrawQuad_Striped(shared_state, | |
| 1483 -- media::VideoFrame::YV12A, | |
| 1484 -- true, | |
| 1485 -- gfx::RectF(0.0f, 0.0f, 1.0f, 1.0f), | |
| 1486 -- pass.get()); | |
| 1487 -- | |
| 1488 -- SolidColorDrawQuad* color_quad = | |
| 1489 -- pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | |
| 1490 -- color_quad->SetNew(shared_state, rect, rect, SK_ColorBLACK, false); | |
| 1491 -- | |
| 1492 -- RenderPassList pass_list; | |
| 1493 -- pass_list.push_back(pass.Pass()); | |
| 1494 -- | |
| 1495 -- EXPECT_TRUE(this->RunPixelTest( | |
| 1496 -- &pass_list, | |
| 1497 -- base::FilePath(FILE_PATH_LITERAL("black.png")), | |
| 1498 -- ExactPixelComparator(true))); | |
| 1499 --} | |
| 1500 -- | |
| 1501 - TYPED_TEST(RendererPixelTest, FastPassColorFilterAlpha) { | |
| 1502 - gfx::Rect viewport_rect(this->device_viewport_size_); | |
| 1503 - | |
| 1504 -diff --git a/cc/quads/yuv_video_draw_quad.h b/cc/quads/yuv_video_draw_quad.h | |
| 1505 -index e1c5410..edda34a 100644 | |
| 1506 ---- a/cc/quads/yuv_video_draw_quad.h | |
| 1507 -+++ b/cc/quads/yuv_video_draw_quad.h | |
| 1508 -@@ -8,7 +8,6 @@ | |
| 1509 - #include "base/basictypes.h" | |
| 1510 - #include "base/memory/scoped_ptr.h" | |
| 1511 - #include "cc/base/cc_export.h" | |
| 1512 --#include "cc/layers/video_layer_impl.h" | |
| 1513 - #include "cc/quads/draw_quad.h" | |
| 1514 - | |
| 1515 - namespace cc { | |
| 1516 -diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_ho
st_impl_unittest.cc | |
| 1517 -index e128013..0b9d976 100644 | |
| 1518 ---- a/cc/trees/layer_tree_host_impl_unittest.cc | |
| 1519 -+++ b/cc/trees/layer_tree_host_impl_unittest.cc | |
| 1520 -@@ -27,7 +27,6 @@ | |
| 1521 - #include "cc/layers/solid_color_scrollbar_layer_impl.h" | |
| 1522 - #include "cc/layers/texture_layer_impl.h" | |
| 1523 - #include "cc/layers/tiled_layer_impl.h" | |
| 1524 --#include "cc/layers/video_layer_impl.h" | |
| 1525 - #include "cc/output/begin_frame_args.h" | |
| 1526 - #include "cc/output/compositor_frame_ack.h" | |
| 1527 - #include "cc/output/compositor_frame_metadata.h" | |
| 1528 -@@ -47,7 +46,6 @@ | |
| 1529 - #include "cc/test/fake_picture_layer_impl.h" | |
| 1530 - #include "cc/test/fake_picture_pile_impl.h" | |
| 1531 - #include "cc/test/fake_proxy.h" | |
| 1532 --#include "cc/test/fake_video_frame_provider.h" | |
| 1533 - #include "cc/test/geometry_test_utils.h" | |
| 1534 - #include "cc/test/layer_test_common.h" | |
| 1535 - #include "cc/test/render_pass_test_common.h" | |
| 1536 -@@ -56,7 +54,6 @@ | |
| 1537 - #include "cc/test/test_web_graphics_context_3d.h" | |
| 1538 - #include "cc/trees/layer_tree_impl.h" | |
| 1539 - #include "cc/trees/single_thread_proxy.h" | |
| 1540 --#include "media/base/media.h" | |
| 1541 - #include "testing/gmock/include/gmock/gmock.h" | |
| 1542 - #include "testing/gtest/include/gtest/gtest.h" | |
| 1543 - #include "third_party/skia/include/core/SkMallocPixelRef.h" | |
| 1544 -@@ -70,7 +67,6 @@ using ::testing::Return; | |
| 1545 - using ::testing::AnyNumber; | |
| 1546 - using ::testing::AtLeast; | |
| 1547 - using ::testing::_; | |
| 1548 --using media::VideoFrame; | |
| 1549 - | |
| 1550 - namespace cc { | |
| 1551 - namespace { | |
| 1552 -@@ -94,7 +90,6 @@ class LayerTreeHostImplTest : public testing::Test, | |
| 1553 - reduce_memory_result_(true), | |
| 1554 - current_limit_bytes_(0), | |
| 1555 - current_priority_cutoff_value_(0) { | |
| 1556 -- media::InitializeMediaLibraryForTesting(); | |
| 1557 - } | |
| 1558 - | |
| 1559 - LayerTreeSettings DefaultSettings() { | |
| 1560 -@@ -5151,18 +5146,6 @@ TEST_F(LayerTreeHostImplTest, LayersFreeTextures) { | |
| 1561 - LayerImpl::Create(host_impl_->active_tree(), 1); | |
| 1562 - root_layer->SetBounds(gfx::Size(10, 10)); | |
| 1563 - | |
| 1564 -- scoped_refptr<VideoFrame> softwareFrame = | |
| 1565 -- media::VideoFrame::CreateColorFrame( | |
| 1566 -- gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | |
| 1567 -- FakeVideoFrameProvider provider; | |
| 1568 -- provider.set_frame(softwareFrame); | |
| 1569 -- scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | |
| 1570 -- host_impl_->active_tree(), 4, &provider, media::VIDEO_ROTATION_0); | |
| 1571 -- video_layer->SetBounds(gfx::Size(10, 10)); | |
| 1572 -- video_layer->SetContentBounds(gfx::Size(10, 10)); | |
| 1573 -- video_layer->SetDrawsContent(true); | |
| 1574 -- root_layer->AddChild(video_layer.Pass()); | |
| 1575 -- | |
| 1576 - scoped_ptr<IOSurfaceLayerImpl> io_surface_layer = | |
| 1577 - IOSurfaceLayerImpl::Create(host_impl_->active_tree(), 5); | |
| 1578 - io_surface_layer->SetBounds(gfx::Size(10, 10)); | |
| 1579 -@@ -6225,16 +6208,6 @@ TEST_F(LayerTreeHostImplTest, | |
| 1580 - scoped_ptr<SolidColorLayerImpl> root_layer = | |
| 1581 - SolidColorLayerImpl::Create(host_impl_->active_tree(), 1); | |
| 1582 - | |
| 1583 -- // VideoLayerImpl will not be drawn. | |
| 1584 -- FakeVideoFrameProvider provider; | |
| 1585 -- scoped_ptr<VideoLayerImpl> video_layer = VideoLayerImpl::Create( | |
| 1586 -- host_impl_->active_tree(), 2, &provider, media::VIDEO_ROTATION_0); | |
| 1587 -- video_layer->SetBounds(gfx::Size(10, 10)); | |
| 1588 -- video_layer->SetContentBounds(gfx::Size(10, 10)); | |
| 1589 -- video_layer->SetDrawsContent(true); | |
| 1590 -- root_layer->AddChild(video_layer.Pass()); | |
| 1591 -- SetupRootLayerImpl(root_layer.Pass()); | |
| 1592 -- | |
| 1593 - LayerTreeHostImpl::FrameData frame; | |
| 1594 - EXPECT_EQ(DRAW_SUCCESS, host_impl_->PrepareToDraw(&frame)); | |
| 1595 - host_impl_->DrawLayers(&frame, gfx::FrameTime::Now()); | |
| 1596 -diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_un
ittest.cc | |
| 1597 -index 2abf6d3..b0ce5a5 100644 | |
| 1598 ---- a/cc/trees/layer_tree_host_unittest.cc | |
| 1599 -+++ b/cc/trees/layer_tree_host_unittest.cc | |
| 1600 -@@ -18,7 +18,6 @@ | |
| 1601 - #include "cc/layers/painted_scrollbar_layer.h" | |
| 1602 - #include "cc/layers/picture_layer.h" | |
| 1603 - #include "cc/layers/solid_color_layer.h" | |
| 1604 --#include "cc/layers/video_layer.h" | |
| 1605 - #include "cc/output/begin_frame_args.h" | |
| 1606 - #include "cc/output/compositor_frame_ack.h" | |
| 1607 - #include "cc/output/copy_output_request.h" | |
| 1608 -@@ -41,7 +40,6 @@ | |
| 1609 - #include "cc/test/fake_picture_pile.h" | |
| 1610 - #include "cc/test/fake_proxy.h" | |
| 1611 - #include "cc/test/fake_scoped_ui_resource.h" | |
| 1612 --#include "cc/test/fake_video_frame_provider.h" | |
| 1613 - #include "cc/test/geometry_test_utils.h" | |
| 1614 - #include "cc/test/layer_tree_test.h" | |
| 1615 - #include "cc/test/test_shared_bitmap_manager.h" | |
| 1616 -@@ -4149,28 +4147,6 @@ class LayerInvalidateCausesDraw : public LayerTreeHostTe
st { | |
| 1617 - int num_draws_; | |
| 1618 - }; | |
| 1619 - | |
| 1620 --// VideoLayer must support being invalidated and then passing that along | |
| 1621 --// to the compositor thread, even though no resources are updated in | |
| 1622 --// response to that invalidation. | |
| 1623 --class LayerTreeHostTestVideoLayerInvalidate : public LayerInvalidateCausesDraw
{ | |
| 1624 -- public: | |
| 1625 -- void SetupTree() override { | |
| 1626 -- LayerTreeHostTest::SetupTree(); | |
| 1627 -- scoped_refptr<VideoLayer> video_layer = | |
| 1628 -- VideoLayer::Create(&provider_, media::VIDEO_ROTATION_0); | |
| 1629 -- video_layer->SetBounds(gfx::Size(10, 10)); | |
| 1630 -- video_layer->SetIsDrawable(true); | |
| 1631 -- layer_tree_host()->root_layer()->AddChild(video_layer); | |
| 1632 -- | |
| 1633 -- invalidate_layer_ = video_layer; | |
| 1634 -- } | |
| 1635 -- | |
| 1636 -- private: | |
| 1637 -- FakeVideoFrameProvider provider_; | |
| 1638 --}; | |
| 1639 -- | |
| 1640 --SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate); | |
| 1641 -- | |
| 1642 - // IOSurfaceLayer must support being invalidated and then passing that along | |
| 1643 - // to the compositor thread, even though no resources are updated in | |
| 1644 - // response to that invalidation. | |
| 1645 -diff --git a/cc/trees/layer_tree_host_unittest_context.cc b/cc/trees/layer_tree
_host_unittest_context.cc | |
| 1646 -index 134d928..dc34d3c 100644 | |
| 1647 ---- a/cc/trees/layer_tree_host_unittest_context.cc | |
| 1648 -+++ b/cc/trees/layer_tree_host_unittest_context.cc | |
| 1649 -@@ -15,8 +15,6 @@ | |
| 1650 - #include "cc/layers/picture_layer.h" | |
| 1651 - #include "cc/layers/texture_layer.h" | |
| 1652 - #include "cc/layers/texture_layer_impl.h" | |
| 1653 --#include "cc/layers/video_layer.h" | |
| 1654 --#include "cc/layers/video_layer_impl.h" | |
| 1655 - #include "cc/output/filter_operations.h" | |
| 1656 - #include "cc/resources/single_release_callback.h" | |
| 1657 - #include "cc/test/fake_content_layer.h" | |
| 1658 -@@ -32,7 +30,6 @@ | |
| 1659 - #include "cc/test/fake_picture_layer_impl.h" | |
| 1660 - #include "cc/test/fake_scoped_ui_resource.h" | |
| 1661 - #include "cc/test/fake_scrollbar.h" | |
| 1662 --#include "cc/test/fake_video_frame_provider.h" | |
| 1663 - #include "cc/test/layer_tree_test.h" | |
| 1664 - #include "cc/test/render_pass_test_common.h" | |
| 1665 - #include "cc/test/test_context_provider.h" | |
| 1666 -@@ -42,9 +39,6 @@ | |
| 1667 - #include "cc/trees/layer_tree_impl.h" | |
| 1668 - #include "cc/trees/single_thread_proxy.h" | |
| 1669 - #include "gpu/GLES2/gl2extchromium.h" | |
| 1670 --#include "media/base/media.h" | |
| 1671 -- | |
| 1672 --using media::VideoFrame; | |
| 1673 - | |
| 1674 - namespace cc { | |
| 1675 - namespace { | |
| 1676 -@@ -65,7 +59,6 @@ class LayerTreeHostContextTest : public LayerTreeTest { | |
| 1677 - context_should_support_io_surface_(false), | |
| 1678 - fallback_context_works_(false), | |
| 1679 - async_output_surface_creation_(false) { | |
| 1680 -- media::InitializeMediaLibraryForTesting(); | |
| 1681 - } | |
| 1682 - | |
| 1683 - void LoseContext() { | |
| 1684 -@@ -1083,49 +1076,6 @@ class LayerTreeHostContextTestDontUseLostResources | |
| 1685 - layer_with_mask->SetMaskLayer(mask.get()); | |
| 1686 - root->AddChild(layer_with_mask); | |
| 1687 - | |
| 1688 -- scoped_refptr<VideoLayer> video_color = | |
| 1689 -- VideoLayer::Create(&color_frame_provider_, media::VIDEO_ROTATION_0); | |
| 1690 -- video_color->SetBounds(gfx::Size(10, 10)); | |
| 1691 -- video_color->SetIsDrawable(true); | |
| 1692 -- root->AddChild(video_color); | |
| 1693 -- | |
| 1694 -- scoped_refptr<VideoLayer> video_hw = | |
| 1695 -- VideoLayer::Create(&hw_frame_provider_, media::VIDEO_ROTATION_0); | |
| 1696 -- video_hw->SetBounds(gfx::Size(10, 10)); | |
| 1697 -- video_hw->SetIsDrawable(true); | |
| 1698 -- root->AddChild(video_hw); | |
| 1699 -- | |
| 1700 -- scoped_refptr<VideoLayer> video_scaled_hw = | |
| 1701 -- VideoLayer::Create(&scaled_hw_frame_provider_, media::VIDEO_ROTATION_0
); | |
| 1702 -- video_scaled_hw->SetBounds(gfx::Size(10, 10)); | |
| 1703 -- video_scaled_hw->SetIsDrawable(true); | |
| 1704 -- root->AddChild(video_scaled_hw); | |
| 1705 -- | |
| 1706 -- color_video_frame_ = VideoFrame::CreateColorFrame( | |
| 1707 -- gfx::Size(4, 4), 0x80, 0x80, 0x80, base::TimeDelta()); | |
| 1708 -- hw_video_frame_ = | |
| 1709 -- VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder( | |
| 1710 -- mailbox, GL_TEXTURE_2D, sync_point))
, | |
| 1711 -- media::VideoFrame::ReleaseMailboxCB(), | |
| 1712 -- gfx::Size(4, 4), | |
| 1713 -- gfx::Rect(0, 0, 4, 4), | |
| 1714 -- gfx::Size(4, 4), | |
| 1715 -- base::TimeDelta(), | |
| 1716 -- VideoFrame::ReadPixelsCB()); | |
| 1717 -- scaled_hw_video_frame_ = | |
| 1718 -- VideoFrame::WrapNativeTexture(make_scoped_ptr(new gpu::MailboxHolder( | |
| 1719 -- mailbox, GL_TEXTURE_2D, sync_point))
, | |
| 1720 -- media::VideoFrame::ReleaseMailboxCB(), | |
| 1721 -- gfx::Size(4, 4), | |
| 1722 -- gfx::Rect(0, 0, 3, 2), | |
| 1723 -- gfx::Size(4, 4), | |
| 1724 -- base::TimeDelta(), | |
| 1725 -- VideoFrame::ReadPixelsCB()); | |
| 1726 -- | |
| 1727 -- color_frame_provider_.set_frame(color_video_frame_); | |
| 1728 -- hw_frame_provider_.set_frame(hw_video_frame_); | |
| 1729 -- scaled_hw_frame_provider_.set_frame(scaled_hw_video_frame_); | |
| 1730 -- | |
| 1731 - if (!delegating_renderer()) { | |
| 1732 - // TODO(danakj): IOSurface layer can not be transported. crbug.com/23933
5 | |
| 1733 - scoped_refptr<IOSurfaceLayer> io_surface = IOSurfaceLayer::Create(); | |
| 1734 -@@ -1155,14 +1105,6 @@ class LayerTreeHostContextTestDontUseLostResources | |
| 1735 - | |
| 1736 - void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | |
| 1737 - LayerTreeHostContextTest::CommitCompleteOnThread(host_impl); | |
| 1738 -- | |
| 1739 -- if (host_impl->active_tree()->source_frame_number() == 3) { | |
| 1740 -- // On the third commit we're recovering from context loss. Hardware | |
| 1741 -- // video frames should not be reused by the VideoFrameProvider, but | |
| 1742 -- // software frames can be. | |
| 1743 -- hw_frame_provider_.set_frame(NULL); | |
| 1744 -- scaled_hw_frame_provider_.set_frame(NULL); | |
| 1745 -- } | |
| 1746 - } | |
| 1747 - | |
| 1748 - DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | |
| 1749 -@@ -1212,14 +1154,6 @@ class LayerTreeHostContextTestDontUseLostResources | |
| 1750 - scoped_refptr<DelegatedFrameResourceCollection> | |
| 1751 - delegated_resource_collection_; | |
| 1752 - scoped_refptr<DelegatedFrameProvider> delegated_frame_provider_; | |
| 1753 -- | |
| 1754 -- scoped_refptr<VideoFrame> color_video_frame_; | |
| 1755 -- scoped_refptr<VideoFrame> hw_video_frame_; | |
| 1756 -- scoped_refptr<VideoFrame> scaled_hw_video_frame_; | |
| 1757 -- | |
| 1758 -- FakeVideoFrameProvider color_frame_provider_; | |
| 1759 -- FakeVideoFrameProvider hw_frame_provider_; | |
| 1760 -- FakeVideoFrameProvider scaled_hw_frame_provider_; | |
| 1761 - }; | |
| 1762 - | |
| 1763 - SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestDontUseLostResources); | |
| OLD | NEW |