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

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

Issue 21159007: cc: Adding support for RGBA_4444 tile textures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a signed vs. unsigned comparison in video_resource_updater.cc Created 7 years, 3 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') | cc/scheduler/texture_uploader.h » ('j') | 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 "base/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 #include "cc/debug/test_web_graphics_context_3d.h" 8 #include "cc/debug/test_web_graphics_context_3d.h"
9 #include "cc/resources/resource_provider.h" 9 #include "cc/resources/resource_provider.h"
10 #include "cc/test/fake_output_surface.h" 10 #include "cc/test/fake_output_surface.h"
11 #include "cc/test/fake_output_surface_client.h" 11 #include "cc/test/fake_output_surface_client.h"
12 #include "media/base/video_frame.h" 12 #include "media/base/video_frame.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace cc { 15 namespace cc {
16 namespace { 16 namespace {
17 17
18 class VideoResourceUpdaterTest : public testing::Test { 18 class VideoResourceUpdaterTest : public testing::Test {
19 protected: 19 protected:
20 VideoResourceUpdaterTest() { 20 VideoResourceUpdaterTest() {
21 scoped_ptr<TestWebGraphicsContext3D> context3d = 21 scoped_ptr<TestWebGraphicsContext3D> context3d =
22 TestWebGraphicsContext3D::Create(); 22 TestWebGraphicsContext3D::Create();
23 context3d_ = context3d.get(); 23 context3d_ = context3d.get();
24 24
25 output_surface3d_ = 25 output_surface3d_ =
26 FakeOutputSurface::Create3d(context3d.Pass()); 26 FakeOutputSurface::Create3d(context3d.Pass());
27 CHECK(output_surface3d_->BindToClient(&client_)); 27 CHECK(output_surface3d_->BindToClient(&client_));
28 resource_provider3d_ = 28 resource_provider3d_ =
29 ResourceProvider::Create(output_surface3d_.get(), 0); 29 ResourceProvider::Create(output_surface3d_.get(), 0, false);
30 } 30 }
31 31
32 scoped_refptr<media::VideoFrame> CreateTestYUVVideoFrame() { 32 scoped_refptr<media::VideoFrame> CreateTestYUVVideoFrame() {
33 const int kDimension = 10; 33 const int kDimension = 10;
34 gfx::Size size(kDimension, kDimension); 34 gfx::Size size(kDimension, kDimension);
35 static uint8 y_data[kDimension * kDimension] = { 0 }; 35 static uint8 y_data[kDimension * kDimension] = { 0 };
36 static uint8 u_data[kDimension * kDimension / 2] = { 0 }; 36 static uint8 u_data[kDimension * kDimension / 2] = { 0 };
37 static uint8 v_data[kDimension * kDimension / 2] = { 0 }; 37 static uint8 v_data[kDimension * kDimension / 2] = { 0 };
38 38
39 return media::VideoFrame::WrapExternalYuvData( 39 return media::VideoFrame::WrapExternalYuvData(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // Fail while creating the mailbox for the second YUV plane. 75 // Fail while creating the mailbox for the second YUV plane.
76 context3d_->set_times_gen_mailbox_succeeds(1); 76 context3d_->set_times_gen_mailbox_succeeds(1);
77 77
78 VideoFrameExternalResources resources = 78 VideoFrameExternalResources resources =
79 updater.CreateExternalResourcesFromVideoFrame(video_frame); 79 updater.CreateExternalResourcesFromVideoFrame(video_frame);
80 EXPECT_EQ(VideoFrameExternalResources::NONE, resources.type); 80 EXPECT_EQ(VideoFrameExternalResources::NONE, resources.type);
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 } // namespace cc 84 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | cc/scheduler/texture_uploader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698