Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/memory/ref_counted_memory.h" | 6 #include "base/memory/ref_counted_memory.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
| 10 #include "base/test/test_suite.h" | 10 #include "base/test/test_suite.h" |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 466 output_frame->stride(media::VideoFrame::kVPlane), 2, output_xsize / 2, | 466 output_frame->stride(media::VideoFrame::kVPlane), 2, output_xsize / 2, |
| 467 output_ysize / 2, &input_pixels, message + " V plane"); | 467 output_ysize / 2, &input_pixels, message + " V plane"); |
| 468 | 468 |
| 469 gl_->DeleteTextures(1, &src_texture); | 469 gl_->DeleteTextures(1, &src_texture); |
| 470 } | 470 } |
| 471 | 471 |
| 472 std::unique_ptr<gpu::GLInProcessContext> context_; | 472 std::unique_ptr<gpu::GLInProcessContext> context_; |
| 473 gpu::gles2::GLES2Interface* gl_; | 473 gpu::gles2::GLES2Interface* gl_; |
| 474 std::unique_ptr<display_compositor::GLHelper> helper_; | 474 std::unique_ptr<display_compositor::GLHelper> helper_; |
| 475 gfx::DisableNullDrawGLBindings enable_pixel_output_; | 475 gfx::DisableNullDrawGLBindings enable_pixel_output_; |
| 476 base::MessageLoop message_loop_; | |
|
Fady Samuel
2016/05/03 18:03:44
Do we use this?
Peng
2016/05/03 18:10:36
It is necessary for those tests.
| |
| 476 }; | 477 }; |
| 477 | 478 |
| 478 TEST_F(YUVReadbackTest, YUVReadbackOptTest) { | 479 TEST_F(YUVReadbackTest, YUVReadbackOptTest) { |
| 479 // This test uses the gpu.service/gpu_decoder tracing events to detect how | 480 // This test uses the gpu.service/gpu_decoder tracing events to detect how |
| 480 // many scaling passes are actually performed by the YUV readback pipeline. | 481 // many scaling passes are actually performed by the YUV readback pipeline. |
| 481 StartTracing(TRACE_DISABLED_BY_DEFAULT( | 482 StartTracing(TRACE_DISABLED_BY_DEFAULT( |
| 482 "gpu.service") "," TRACE_DISABLED_BY_DEFAULT("gpu_decoder")); | 483 "gpu.service") "," TRACE_DISABLED_BY_DEFAULT("gpu_decoder")); |
| 483 | 484 |
| 484 TestYUVReadback(800, 400, 800, 400, 0, 0, 1, false, true, | 485 TestYUVReadback(800, 400, 800, 400, 0, 0, 1, false, true, |
| 485 display_compositor::GLHelper::SCALER_QUALITY_FAST); | 486 display_compositor::GLHelper::SCALER_QUALITY_FAST); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 545 INSTANTIATE_TEST_CASE_P( | 546 INSTANTIATE_TEST_CASE_P( |
| 546 , | 547 , |
| 547 YUVReadbackPixelTest, | 548 YUVReadbackPixelTest, |
| 548 ::testing::Combine( | 549 ::testing::Combine( |
| 549 ::testing::Bool(), | 550 ::testing::Bool(), |
| 550 ::testing::Bool(), | 551 ::testing::Bool(), |
| 551 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)), | 552 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)), |
| 552 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)))); | 553 ::testing::Range<unsigned int>(0, arraysize(kYUVReadbackSizes)))); |
| 553 | 554 |
| 554 } // namespace display_compositor | 555 } // namespace display_compositor |
| OLD | NEW |