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

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

Issue 664803003: Update from chromium a8e7c94b1b79a0948d05a1fcfff53391d22ce37a (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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/tile_manager_unittest.cc ('k') | cc/surfaces/display.cc » ('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/resources/resource_provider.h" 8 #include "cc/resources/resource_provider.h"
9 #include "cc/test/fake_output_surface.h" 9 #include "cc/test/fake_output_surface.h"
10 #include "cc/test/fake_output_surface_client.h" 10 #include "cc/test/fake_output_surface_client.h"
(...skipping 17 matching lines...) Expand all
28 FakeOutputSurface::Create3d(context3d.Pass()); 28 FakeOutputSurface::Create3d(context3d.Pass());
29 CHECK(output_surface3d_->BindToClient(&client_)); 29 CHECK(output_surface3d_->BindToClient(&client_));
30 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); 30 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
31 resource_provider3d_ = 31 resource_provider3d_ =
32 ResourceProvider::Create(output_surface3d_.get(), 32 ResourceProvider::Create(output_surface3d_.get(),
33 shared_bitmap_manager_.get(), 33 shared_bitmap_manager_.get(),
34 NULL, 34 NULL,
35 NULL, 35 NULL,
36 0, 36 0,
37 false, 37 false,
38 1, 38 1);
39 false);
40 } 39 }
41 40
42 scoped_refptr<media::VideoFrame> CreateTestYUVVideoFrame() { 41 scoped_refptr<media::VideoFrame> CreateTestYUVVideoFrame() {
43 const int kDimension = 10; 42 const int kDimension = 10;
44 gfx::Size size(kDimension, kDimension); 43 gfx::Size size(kDimension, kDimension);
45 static uint8 y_data[kDimension * kDimension] = { 0 }; 44 static uint8 y_data[kDimension * kDimension] = { 0 };
46 static uint8 u_data[kDimension * kDimension / 2] = { 0 }; 45 static uint8 u_data[kDimension * kDimension / 2] = { 0 };
47 static uint8 v_data[kDimension * kDimension / 2] = { 0 }; 46 static uint8 v_data[kDimension * kDimension / 2] = { 0 };
48 47
49 return media::VideoFrame::WrapExternalYuvData( 48 return media::VideoFrame::WrapExternalYuvData(
(...skipping 23 matching lines...) Expand all
73 resource_provider3d_.get()); 72 resource_provider3d_.get());
74 scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame(); 73 scoped_refptr<media::VideoFrame> video_frame = CreateTestYUVVideoFrame();
75 74
76 VideoFrameExternalResources resources = 75 VideoFrameExternalResources resources =
77 updater.CreateExternalResourcesFromVideoFrame(video_frame); 76 updater.CreateExternalResourcesFromVideoFrame(video_frame);
78 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type); 77 EXPECT_EQ(VideoFrameExternalResources::YUV_RESOURCE, resources.type);
79 } 78 }
80 79
81 } // namespace 80 } // namespace
82 } // namespace cc 81 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698