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

Side by Side Diff: content/common/gpu/client/gl_helper_unittest.cc

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Folded sync_point into sync_tokens Created 5 years, 1 month 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 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
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(context_->insertSyncPoint());
1367 1367
1368 std::string message = base::StringPrintf( 1368 std::string message = base::StringPrintf(
1369 "input size: %dx%d " 1369 "input size: %dx%d "
1370 "output size: %dx%d " 1370 "output size: %dx%d "
1371 "margin: %dx%d " 1371 "margin: %dx%d "
1372 "pattern: %d %s %s", 1372 "pattern: %d %s %s",
1373 xsize, 1373 xsize,
1374 ysize, 1374 ysize,
1375 output_xsize, 1375 output_xsize,
1376 output_ysize, 1376 output_ysize,
(...skipping 23 matching lines...) Expand all
1400 gfx::Size(output_xsize, output_ysize), 1400 gfx::Size(output_xsize, output_ysize),
1401 base::TimeDelta::FromSeconds(0)); 1401 base::TimeDelta::FromSeconds(0));
1402 scoped_refptr<media::VideoFrame> truth_frame = 1402 scoped_refptr<media::VideoFrame> truth_frame =
1403 media::VideoFrame::CreateFrame( 1403 media::VideoFrame::CreateFrame(
1404 media::PIXEL_FORMAT_YV12, gfx::Size(output_xsize, output_ysize), 1404 media::PIXEL_FORMAT_YV12, gfx::Size(output_xsize, output_ysize),
1405 gfx::Rect(0, 0, output_xsize, output_ysize), 1405 gfx::Rect(0, 0, output_xsize, output_ysize),
1406 gfx::Size(output_xsize, output_ysize), 1406 gfx::Size(output_xsize, output_ysize),
1407 base::TimeDelta::FromSeconds(0)); 1407 base::TimeDelta::FromSeconds(0));
1408 1408
1409 base::RunLoop run_loop; 1409 base::RunLoop run_loop;
1410 yuv_reader->ReadbackYUV(mailbox, 1410 yuv_reader->ReadbackYUV(mailbox, sync_token, output_frame.get(),
1411 sync_point,
1412 output_frame.get(),
1413 gfx::Point(xmargin, ymargin), 1411 gfx::Point(xmargin, ymargin),
1414 base::Bind(&callcallback, run_loop.QuitClosure())); 1412 base::Bind(&callcallback, run_loop.QuitClosure()));
1415 run_loop.Run(); 1413 run_loop.Run();
1416 1414
1417 if (flip) { 1415 if (flip) {
1418 FlipSKBitmap(&input_pixels); 1416 FlipSKBitmap(&input_pixels);
1419 } 1417 }
1420 1418
1421 unsigned char* Y = truth_frame->visible_data(media::VideoFrame::kYPlane); 1419 unsigned char* Y = truth_frame->visible_data(media::VideoFrame::kYPlane);
1422 unsigned char* U = truth_frame->visible_data(media::VideoFrame::kUPlane); 1420 unsigned char* U = truth_frame->visible_data(media::VideoFrame::kUPlane);
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 base::TestSuite* suite = new content::ContentTestSuite(argc, argv); 1981 base::TestSuite* suite = new content::ContentTestSuite(argc, argv);
1984 #if defined(OS_MACOSX) 1982 #if defined(OS_MACOSX)
1985 base::mac::ScopedNSAutoreleasePool pool; 1983 base::mac::ScopedNSAutoreleasePool pool;
1986 #endif 1984 #endif
1987 1985
1988 return base::LaunchUnitTestsSerially( 1986 return base::LaunchUnitTestsSerially(
1989 argc, 1987 argc,
1990 argv, 1988 argv,
1991 base::Bind(&RunHelper, base::Unretained(suite))); 1989 base::Bind(&RunHelper, base::Unretained(suite)));
1992 } 1990 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698