Index: cc/test/pixel_test_output_surface.cc |
diff --git a/cc/test/pixel_test_output_surface.cc b/cc/test/pixel_test_output_surface.cc |
index 11424c003caf199ec11212a4244818fc5f6f8bfc..e9c6b79af010e93a52b20dd6e6fda7bee04d2d68 100644 |
--- a/cc/test/pixel_test_output_surface.cc |
+++ b/cc/test/pixel_test_output_surface.cc |
@@ -6,6 +6,8 @@ |
#include <utility> |
+#include "base/bind.h" |
+#include "base/threading/thread_task_runner_handle.h" |
#include "cc/output/output_surface_client.h" |
#include "cc/output/output_surface_frame.h" |
#include "gpu/command_buffer/client/gles2_interface.h" |
@@ -17,15 +19,13 @@ namespace cc { |
PixelTestOutputSurface::PixelTestOutputSurface( |
scoped_refptr<ContextProvider> context_provider, |
bool flipped_output_surface) |
- : OutputSurface(std::move(context_provider)), |
- external_stencil_test_(false) { |
+ : OutputSurface(std::move(context_provider)), weak_ptr_factory_(this) { |
capabilities_.flipped_output_surface = flipped_output_surface; |
} |
PixelTestOutputSurface::PixelTestOutputSurface( |
std::unique_ptr<SoftwareOutputDevice> software_device) |
- : OutputSurface(std::move(software_device)), |
- external_stencil_test_(false) {} |
+ : OutputSurface(std::move(software_device)), weak_ptr_factory_(this) {} |
PixelTestOutputSurface::~PixelTestOutputSurface() = default; |
@@ -56,7 +56,13 @@ bool PixelTestOutputSurface::HasExternalStencilTest() const { |
void PixelTestOutputSurface::ApplyExternalStencil() {} |
void PixelTestOutputSurface::SwapBuffers(OutputSurfaceFrame frame) { |
- PostSwapBuffersComplete(); |
+ base::ThreadTaskRunnerHandle::Get()->PostTask( |
+ FROM_HERE, base::Bind(&PixelTestOutputSurface::SwapBuffersCallback, |
+ weak_ptr_factory_.GetWeakPtr())); |
+} |
+ |
+void PixelTestOutputSurface::SwapBuffersCallback() { |
+ client_->DidSwapBuffersComplete(); |
} |
OverlayCandidateValidator* |