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

Unified Diff: cc/resources/video_resource_updater_unittest.cc

Issue 2763223003: Reland of cc: Don't use StreamVideoDrawQuad on any platform but Android. (Closed)
Patch Set: Fix tests. Created 3 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater_unittest.cc
diff --git a/cc/resources/video_resource_updater_unittest.cc b/cc/resources/video_resource_updater_unittest.cc
index 3c7874e498ecb6e984d5045f95dd2087a0f2904a..135d14453b68d4109d21b7b7b3d614848d9ce157 100644
--- a/cc/resources/video_resource_updater_unittest.cc
+++ b/cc/resources/video_resource_updater_unittest.cc
@@ -249,8 +249,10 @@ class VideoResourceUpdaterTest : public testing::Test {
};
TEST_F(VideoResourceUpdaterTest, SoftwareFrame) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
VideoFrameExternalResources resources =
@@ -259,8 +261,10 @@ TEST_F(VideoResourceUpdaterTest, SoftwareFrame) {
}
TEST_F(VideoResourceUpdaterTest, HighBitFrameNoF16) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame();
VideoFrameExternalResources resources =
@@ -276,8 +280,10 @@ class VideoResourceUpdaterTestWithF16 : public VideoResourceUpdaterTest {
};
TEST_F(VideoResourceUpdaterTestWithF16, HighBitFrame) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame();
VideoFrameExternalResources resources =
@@ -296,7 +302,9 @@ TEST_F(VideoResourceUpdaterTestWithF16, HighBitFrame) {
}
TEST_F(VideoResourceUpdaterTest, HighBitFrameSoftwareCompositor) {
- VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(nullptr, resource_provider_software_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame();
VideoFrameExternalResources resources =
@@ -305,8 +313,10 @@ TEST_F(VideoResourceUpdaterTest, HighBitFrameSoftwareCompositor) {
}
TEST_F(VideoResourceUpdaterTest, WonkySoftwareFrame) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateWonkyTestYUVVideoFrame();
VideoFrameExternalResources resources =
@@ -315,7 +325,9 @@ TEST_F(VideoResourceUpdaterTest, WonkySoftwareFrame) {
}
TEST_F(VideoResourceUpdaterTest, WonkySoftwareFrameSoftwareCompositor) {
- VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(nullptr, resource_provider_software_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateWonkyTestYUVVideoFrame();
VideoFrameExternalResources resources =
@@ -324,8 +336,10 @@ TEST_F(VideoResourceUpdaterTest, WonkySoftwareFrameSoftwareCompositor) {
}
TEST_F(VideoResourceUpdaterTest, ReuseResource) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
video_frame->set_timestamp(base::TimeDelta::FromSeconds(1234));
@@ -356,8 +370,10 @@ TEST_F(VideoResourceUpdaterTest, ReuseResource) {
}
TEST_F(VideoResourceUpdaterTest, ReuseResourceNoDelete) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
video_frame->set_timestamp(base::TimeDelta::FromSeconds(1234));
@@ -383,7 +399,9 @@ TEST_F(VideoResourceUpdaterTest, ReuseResourceNoDelete) {
}
TEST_F(VideoResourceUpdaterTest, SoftwareFrameSoftwareCompositor) {
- VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(nullptr, resource_provider_software_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
VideoFrameExternalResources resources =
@@ -392,7 +410,9 @@ TEST_F(VideoResourceUpdaterTest, SoftwareFrameSoftwareCompositor) {
}
TEST_F(VideoResourceUpdaterTest, ReuseResourceSoftwareCompositor) {
- VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(nullptr, resource_provider_software_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
video_frame->set_timestamp(base::TimeDelta::FromSeconds(1234));
@@ -423,7 +443,9 @@ TEST_F(VideoResourceUpdaterTest, ReuseResourceSoftwareCompositor) {
}
TEST_F(VideoResourceUpdaterTest, ReuseResourceNoDeleteSoftwareCompositor) {
- VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(nullptr, resource_provider_software_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
video_frame->set_timestamp(base::TimeDelta::FromSeconds(1234));
@@ -450,8 +472,10 @@ TEST_F(VideoResourceUpdaterTest, ReuseResourceNoDeleteSoftwareCompositor) {
}
TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes) {
+ bool use_stream_video_draw_quad = false;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
scoped_refptr<media::VideoFrame> video_frame =
CreateTestRGBAHardwareVideoFrame();
@@ -482,8 +506,10 @@ TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes) {
}
TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_StreamTexture) {
+ bool use_stream_video_draw_quad = true;
VideoResourceUpdater updater(context_provider_.get(),
- resource_provider3d_.get());
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
context3d_->ResetTextureCreationCount();
scoped_refptr<media::VideoFrame> video_frame =
CreateTestStreamTextureHardwareVideoFrame(false);
@@ -504,7 +530,8 @@ TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_StreamTexture) {
video_frame = CreateTestStreamTextureHardwareVideoFrame(true);
context3d_->ResetImmutableTextureCreated();
resources = updater.CreateExternalResourcesFromVideoFrame(video_frame);
- EXPECT_EQ(VideoFrameExternalResources::RGBA_RESOURCE, resources.type);
+ EXPECT_EQ(VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE,
+ resources.type);
EXPECT_EQ(1u, resources.mailboxes.size());
EXPECT_EQ((GLenum)GL_TEXTURE_2D, resources.mailboxes[0].target());
EXPECT_EQ(1u, resources.release_callbacks.size());
@@ -519,5 +546,25 @@ TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_StreamTexture) {
EXPECT_FALSE(context3d_->WasImmutableTextureCreated());
}
+TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_TextureQuad) {
+ bool use_stream_video_draw_quad = false;
+ VideoResourceUpdater updater(context_provider_.get(),
+ resource_provider3d_.get(),
+ use_stream_video_draw_quad);
+ context3d_->ResetTextureCreationCount();
+ scoped_refptr<media::VideoFrame> video_frame =
+ CreateTestStreamTextureHardwareVideoFrame(false);
+
+ VideoFrameExternalResources resources =
+ updater.CreateExternalResourcesFromVideoFrame(video_frame);
+ EXPECT_EQ(VideoFrameExternalResources::RGBA_PREMULTIPLIED_RESOURCE,
+ resources.type);
+ EXPECT_EQ(1u, resources.mailboxes.size());
+ EXPECT_EQ((GLenum)GL_TEXTURE_EXTERNAL_OES, resources.mailboxes[0].target());
+ EXPECT_EQ(1u, resources.release_callbacks.size());
+ EXPECT_EQ(0u, resources.software_resources.size());
+ EXPECT_EQ(0, context3d_->TextureCreationCount());
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/trees/layer_tree_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698