LayerTreePixelTest::LayerTreePixelTest()
: pixel_comparator_(new ExactPixelComparator(true)),
- test_type_(GL_WITH_DEFAULT),
+ test_type_(PIXEL_TEST_GL),
pending_texture_mailbox_callbacks_(0),
- impl_side_painting_(true) {}
+ impl_side_painting_(true) {
+}
LayerTreePixelTest::~LayerTreePixelTest() {}
scoped_ptr<PixelTestOutputSurface> output_surface;
switch (test_type_) {
- case SOFTWARE_WITH_DEFAULT:
- case SOFTWARE_WITH_BITMAP: {
+ case PIXEL_TEST_SOFTWARE: {
scoped_ptr<PixelTestSoftwareOutputDevice> software_output_device(
new PixelTestSoftwareOutputDevice);
software_output_device->set_surface_expansion_size(
surface_expansion_size);
output_surface = make_scoped_ptr(
- new PixelTestOutputSurface(
- software_output_device.PassAs<SoftwareOutputDevice>()));
+ new PixelTestOutputSurface(software_output_device.Pass()));
break;
}
-
- case GL_WITH_DEFAULT:
- case GL_WITH_BITMAP: {
- output_surface = make_scoped_ptr(
- new PixelTestOutputSurface(new TestInProcessContextProvider));
+ case PIXEL_TEST_GL: {
+ bool flipped_output_surface = false;
+ output_surface = make_scoped_ptr(new PixelTestOutputSurface(
+ new TestInProcessContextProvider, flipped_output_surface));
break;
}
}
output_surface->set_surface_expansion_size(surface_expansion_size);
- return output_surface.PassAs<OutputSurface>();
+ return output_surface.Pass();
}
void LayerTreePixelTest::CommitCompleteOnThread(LayerTreeHostImpl* impl) {
// Drop TextureMailboxes on the main thread so that they can be cleaned up and
// the pending callbacks will fire.
for (size_t i = 0; i < texture_layers_.size(); ++i) {
- texture_layers_[i]->SetTextureMailbox(TextureMailbox(),
- scoped_ptr<SingleReleaseCallback>());
+ texture_layers_[i]->SetTextureMailbox(TextureMailbox(), nullptr);
}
TryEndTest();
content_root_ = content_root;
readback_target_ = NULL;
ref_file_ = file_name;
- RunTest(true, false, impl_side_painting_);
+ bool threaded = true;
+ RunTest(threaded, false, impl_side_painting_);
+}
+
+void LayerTreePixelTest::RunSingleThreadedPixelTest(
+ PixelTestType test_type,
+ scoped_refptr<Layer> content_root,
+ base::FilePath file_name) {
+ test_type_ = test_type;
+ content_root_ = content_root;
+ readback_target_ = NULL;
+ ref_file_ = file_name;
+ bool threaded = false;
+ RunTest(threaded, false, impl_side_painting_);
}
void LayerTreePixelTest::RunPixelTestWithReadbackTarget(
const TextureMailbox& texture_mailbox) {
DCHECK(texture_mailbox.IsTexture());
if (!texture_mailbox.IsTexture())
- return scoped_ptr<SkBitmap>();
+ return nullptr;
scoped_ptr<gpu::GLInProcessContext> context = CreateTestInProcessContext();
GLES2Interface* gl = context->GetImplementation();