| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdio.h> | 5 #include <stdio.h> |
| 6 #include <cmath> | 6 #include <cmath> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 ysize, | 1356 ysize, |
| 1357 0, | 1357 0, |
| 1358 GL_RGBA, | 1358 GL_RGBA, |
| 1359 GL_UNSIGNED_BYTE, | 1359 GL_UNSIGNED_BYTE, |
| 1360 input_pixels.getPixels()); | 1360 input_pixels.getPixels()); |
| 1361 | 1361 |
| 1362 gpu::Mailbox mailbox; | 1362 gpu::Mailbox mailbox; |
| 1363 context_->genMailboxCHROMIUM(mailbox.name); | 1363 context_->genMailboxCHROMIUM(mailbox.name); |
| 1364 EXPECT_FALSE(mailbox.IsZero()); | 1364 EXPECT_FALSE(mailbox.IsZero()); |
| 1365 context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); | 1365 context_->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
| 1366 uint32 sync_point = context_->insertSyncPoint(); | 1366 gpu::SyncToken sync_token; |
| 1367 ASSERT_TRUE(context_->insertSyncPoint(sync_token.GetData())); |
| 1367 | 1368 |
| 1368 std::string message = base::StringPrintf( | 1369 std::string message = base::StringPrintf( |
| 1369 "input size: %dx%d " | 1370 "input size: %dx%d " |
| 1370 "output size: %dx%d " | 1371 "output size: %dx%d " |
| 1371 "margin: %dx%d " | 1372 "margin: %dx%d " |
| 1372 "pattern: %d %s %s", | 1373 "pattern: %d %s %s", |
| 1373 xsize, | 1374 xsize, |
| 1374 ysize, | 1375 ysize, |
| 1375 output_xsize, | 1376 output_xsize, |
| 1376 output_ysize, | 1377 output_ysize, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1400 gfx::Size(output_xsize, output_ysize), | 1401 gfx::Size(output_xsize, output_ysize), |
| 1401 base::TimeDelta::FromSeconds(0)); | 1402 base::TimeDelta::FromSeconds(0)); |
| 1402 scoped_refptr<media::VideoFrame> truth_frame = | 1403 scoped_refptr<media::VideoFrame> truth_frame = |
| 1403 media::VideoFrame::CreateFrame( | 1404 media::VideoFrame::CreateFrame( |
| 1404 media::PIXEL_FORMAT_YV12, gfx::Size(output_xsize, output_ysize), | 1405 media::PIXEL_FORMAT_YV12, gfx::Size(output_xsize, output_ysize), |
| 1405 gfx::Rect(0, 0, output_xsize, output_ysize), | 1406 gfx::Rect(0, 0, output_xsize, output_ysize), |
| 1406 gfx::Size(output_xsize, output_ysize), | 1407 gfx::Size(output_xsize, output_ysize), |
| 1407 base::TimeDelta::FromSeconds(0)); | 1408 base::TimeDelta::FromSeconds(0)); |
| 1408 | 1409 |
| 1409 base::RunLoop run_loop; | 1410 base::RunLoop run_loop; |
| 1410 yuv_reader->ReadbackYUV(mailbox, | 1411 yuv_reader->ReadbackYUV(mailbox, sync_token, output_frame.get(), |
| 1411 sync_point, | |
| 1412 output_frame.get(), | |
| 1413 gfx::Point(xmargin, ymargin), | 1412 gfx::Point(xmargin, ymargin), |
| 1414 base::Bind(&callcallback, run_loop.QuitClosure())); | 1413 base::Bind(&callcallback, run_loop.QuitClosure())); |
| 1415 run_loop.Run(); | 1414 run_loop.Run(); |
| 1416 | 1415 |
| 1417 if (flip) { | 1416 if (flip) { |
| 1418 FlipSKBitmap(&input_pixels); | 1417 FlipSKBitmap(&input_pixels); |
| 1419 } | 1418 } |
| 1420 | 1419 |
| 1421 unsigned char* Y = truth_frame->visible_data(media::VideoFrame::kYPlane); | 1420 unsigned char* Y = truth_frame->visible_data(media::VideoFrame::kYPlane); |
| 1422 unsigned char* U = truth_frame->visible_data(media::VideoFrame::kUPlane); | 1421 unsigned char* U = truth_frame->visible_data(media::VideoFrame::kUPlane); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1983 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); | 1982 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); |
| 1984 #if defined(OS_MACOSX) | 1983 #if defined(OS_MACOSX) |
| 1985 base::mac::ScopedNSAutoreleasePool pool; | 1984 base::mac::ScopedNSAutoreleasePool pool; |
| 1986 #endif | 1985 #endif |
| 1987 | 1986 |
| 1988 return base::LaunchUnitTestsSerially( | 1987 return base::LaunchUnitTestsSerially( |
| 1989 argc, | 1988 argc, |
| 1990 argv, | 1989 argv, |
| 1991 base::Bind(&RunHelper, base::Unretained(suite))); | 1990 base::Bind(&RunHelper, base::Unretained(suite))); |
| 1992 } | 1991 } |
| OLD | NEW |