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

Side by Side 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: Address Dana's comments. Fix unittest. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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 "cc/resources/video_resource_updater.h" 5 #include "cc/resources/video_resource_updater.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 video_frame = CreateTestYuvHardwareVideoFrame(); 476 video_frame = CreateTestYuvHardwareVideoFrame();
477 video_frame->metadata()->SetBoolean( 477 video_frame->metadata()->SetBoolean(
478 media::VideoFrameMetadata::READ_LOCK_FENCES_ENABLED, true); 478 media::VideoFrameMetadata::READ_LOCK_FENCES_ENABLED, true);
479 479
480 resources = updater.CreateExternalResourcesFromVideoFrame(video_frame); 480 resources = updater.CreateExternalResourcesFromVideoFrame(video_frame);
481 EXPECT_TRUE(resources.read_lock_fences_enabled); 481 EXPECT_TRUE(resources.read_lock_fences_enabled);
482 } 482 }
483 483
484 TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_StreamTexture) { 484 TEST_F(VideoResourceUpdaterTest, CreateForHardwarePlanes_StreamTexture) {
485 VideoResourceUpdater updater(context_provider_.get(), 485 VideoResourceUpdater updater(context_provider_.get(),
486 resource_provider3d_.get()); 486 resource_provider3d_.get(), true);
danakj 2017/03/28 15:44:13 nit: give the true a name either with a temp bool
Daniele Castagna 2017/03/29 20:38:18 Done.
487 context3d_->ResetTextureCreationCount(); 487 context3d_->ResetTextureCreationCount();
488 scoped_refptr<media::VideoFrame> video_frame = 488 scoped_refptr<media::VideoFrame> video_frame =
489 CreateTestStreamTextureHardwareVideoFrame(false); 489 CreateTestStreamTextureHardwareVideoFrame(false);
490 490
491 VideoFrameExternalResources resources = 491 VideoFrameExternalResources resources =
492 updater.CreateExternalResourcesFromVideoFrame(video_frame); 492 updater.CreateExternalResourcesFromVideoFrame(video_frame);
493 EXPECT_EQ(VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE, 493 EXPECT_EQ(VideoFrameExternalResources::STREAM_TEXTURE_RESOURCE,
494 resources.type); 494 resources.type);
495 EXPECT_EQ(1u, resources.mailboxes.size()); 495 EXPECT_EQ(1u, resources.mailboxes.size());
496 EXPECT_EQ((GLenum)GL_TEXTURE_EXTERNAL_OES, resources.mailboxes[0].target()); 496 EXPECT_EQ((GLenum)GL_TEXTURE_EXTERNAL_OES, resources.mailboxes[0].target());
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]); 571 FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]);
572 EXPECT_NEAR(FromHalfFloat(half_floats[i]), expected_value, 572 EXPECT_NEAR(FromHalfFloat(half_floats[i]), expected_value,
573 expected_precision) 573 expected_precision)
574 << "i = " << i << " bits = " << bits; 574 << "i = " << i << " bits = " << bits;
575 } 575 }
576 } 576 }
577 } 577 }
578 578
579 } // namespace 579 } // namespace
580 } // namespace cc 580 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698