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

Unified Diff: cc/test/pixel_test_output_surface.cc

Issue 2402173002: cc: Get rid of PostSwapBuffersComplete. (Closed)
Patch Set: postswap: fix-blimp-unittest-post-swap-acks Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/pixel_test_output_surface.h ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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*
« no previous file with comments | « cc/test/pixel_test_output_surface.h ('k') | cc/test/test_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698