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

Unified Diff: cc/test/pixel_test_output_surface.cc

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really revert task runner changes Created 4 years, 8 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
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 421afc03a7343e340766f4073be7fefbc0ab01f2..d5ac4c1f1b9478c535811a34dd247a9d6187768f 100644
--- a/cc/test/pixel_test_output_surface.cc
+++ b/cc/test/pixel_test_output_surface.cc
@@ -5,6 +5,7 @@
#include "cc/test/pixel_test_output_surface.h"
#include "cc/output/output_surface_client.h"
+#include "cc/scheduler/begin_frame_source.h"
#include "ui/gfx/transform.h"
namespace cc {
@@ -12,8 +13,10 @@ namespace cc {
PixelTestOutputSurface::PixelTestOutputSurface(
scoped_refptr<ContextProvider> context_provider,
scoped_refptr<ContextProvider> worker_context_provider,
- bool flipped_output_surface)
+ bool flipped_output_surface,
+ scoped_ptr<BeginFrameSource> begin_frame_source)
: OutputSurface(context_provider, worker_context_provider),
+ begin_frame_source_(std::move(begin_frame_source)),
external_stencil_test_(false) {
capabilities_.adjust_deadline_for_parent = false;
capabilities_.flipped_output_surface = flipped_output_surface;
@@ -21,17 +24,33 @@ PixelTestOutputSurface::PixelTestOutputSurface(
PixelTestOutputSurface::PixelTestOutputSurface(
scoped_refptr<ContextProvider> context_provider,
- bool flipped_output_surface)
+ bool flipped_output_surface,
+ scoped_ptr<BeginFrameSource> begin_frame_source)
: PixelTestOutputSurface(context_provider,
nullptr,
- flipped_output_surface) {
-}
+ flipped_output_surface,
+ std::move(begin_frame_source)) {}
PixelTestOutputSurface::PixelTestOutputSurface(
- scoped_ptr<SoftwareOutputDevice> software_device)
+ scoped_ptr<SoftwareOutputDevice> software_device,
+ scoped_ptr<BeginFrameSource> begin_frame_source)
: OutputSurface(std::move(software_device)),
+ begin_frame_source_(std::move(begin_frame_source)),
external_stencil_test_(false) {}
+PixelTestOutputSurface::~PixelTestOutputSurface() {}
+
+bool PixelTestOutputSurface::BindToClient(OutputSurfaceClient* client) {
+ if (!OutputSurface::BindToClient(client))
+ return false;
+
+ // TODO(enne): Once the renderer uses begin frame sources, this will
+ // always be valid.
+ if (begin_frame_source_)
+ client->SetBeginFrameSource(begin_frame_source_.get());
+ return true;
+}
+
void PixelTestOutputSurface::Reshape(const gfx::Size& size,
float scale_factor,
bool has_alpha) {

Powered by Google App Engine
This is Rietveld 408576698