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

Side by Side Diff: cc/resources/video_resource_updater_unittest.cc

Issue 2395943002: fix highbit video (Closed)
Patch Set: test added, comment addressed Created 4 years, 2 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
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 }; 271 };
272 272
273 TEST_F(VideoResourceUpdaterTestWithF16, HighBitFrame) { 273 TEST_F(VideoResourceUpdaterTestWithF16, HighBitFrame) {
274 VideoResourceUpdater updater(context_provider_.get(), 274 VideoResourceUpdater updater(context_provider_.get(),
275 resource_provider3d_.get()); 275 resource_provider3d_.get());
276 scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame(); 276 scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame();
277 277
278 VideoFrameExternalResources resources = 278 VideoFrameExternalResources resources =
279 updater.CreateExternalResourcesFromVideoFrame(video_frame); 279 updater.CreateExternalResourcesFromVideoFrame(video_frame);
280 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); 280 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type);
281 EXPECT_NEAR(resources.multiplier, 2.0, 0.1);
282 EXPECT_NEAR(resources.offset, 0.5, 0.1);
283 VideoFrameExternalResources resources2 =
danakj 2016/10/06 00:19:06 What's this 2nd case testing that's diffrent?
hubbe 2016/10/06 00:21:51 Comment added.
284 updater.CreateExternalResourcesFromVideoFrame(video_frame);
285 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources2.type);
286 EXPECT_NEAR(resources2.multiplier, 2.0, 0.1);
287 EXPECT_NEAR(resources2.offset, 0.5, 0.1);
281 } 288 }
282 289
283 TEST_F(VideoResourceUpdaterTest, HighBitFrameSoftwareCompositor) { 290 TEST_F(VideoResourceUpdaterTest, HighBitFrameSoftwareCompositor) {
284 VideoResourceUpdater updater(nullptr, resource_provider_software_.get()); 291 VideoResourceUpdater updater(nullptr, resource_provider_software_.get());
285 scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame(); 292 scoped_refptr<media::VideoFrame> video_frame = CreateTestHighBitFrame();
286 293
287 VideoFrameExternalResources resources = 294 VideoFrameExternalResources resources =
288 updater.CreateExternalResourcesFromVideoFrame(video_frame); 295 updater.CreateExternalResourcesFromVideoFrame(video_frame);
289 EXPECT_EQ(VideoFrameExternalResources::SOFTWARE_RESOURCE, resources.type); 296 EXPECT_EQ(VideoFrameExternalResources::SOFTWARE_RESOURCE, resources.type);
290 } 297 }
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]); 555 FromHalfFloat(half_floats[i] + 1) - FromHalfFloat(half_floats[i]);
549 EXPECT_NEAR(FromHalfFloat(half_floats[i]), integers[i] * multiplier, 556 EXPECT_NEAR(FromHalfFloat(half_floats[i]), integers[i] * multiplier,
550 expected_precision) 557 expected_precision)
551 << "i = " << i << " bits = " << bits; 558 << "i = " << i << " bits = " << bits;
552 } 559 }
553 } 560 }
554 } 561 }
555 562
556 } // namespace 563 } // namespace
557 } // namespace cc 564 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698