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

Unified Diff: trunk/src/cc/test/fake_output_surface.cc

Issue 17204002: Revert 206020 "cc: Emulate BeginFrame in OutputSurfaces that don..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 | « trunk/src/cc/test/fake_output_surface.h ('k') | trunk/src/cc/test/layer_tree_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cc/test/fake_output_surface.cc
===================================================================
--- trunk/src/cc/test/fake_output_surface.cc (revision 206654)
+++ trunk/src/cc/test/fake_output_surface.cc (working copy)
@@ -8,7 +8,6 @@
#include "base/message_loop.h"
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/output_surface_client.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -18,8 +17,7 @@
: OutputSurface(context3d.Pass()),
num_sent_frames_(0),
needs_begin_frame_(false),
- forced_draw_to_software_device_(false),
- fake_weak_ptr_factory_(this) {
+ forced_draw_to_software_device_(false) {
if (delegated_rendering) {
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
@@ -30,8 +28,7 @@
scoped_ptr<SoftwareOutputDevice> software_device, bool delegated_rendering)
: OutputSurface(software_device.Pass()),
num_sent_frames_(0),
- forced_draw_to_software_device_(false),
- fake_weak_ptr_factory_(this) {
+ forced_draw_to_software_device_(false) {
if (delegated_rendering) {
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
@@ -44,8 +41,7 @@
bool delegated_rendering)
: OutputSurface(context3d.Pass(), software_device.Pass()),
num_sent_frames_(0),
- forced_draw_to_software_device_(false),
- fake_weak_ptr_factory_(this) {
+ forced_draw_to_software_device_(false) {
if (delegated_rendering) {
capabilities_.delegated_rendering = true;
capabilities_.max_frames_pending = 1;
@@ -60,7 +56,6 @@
frame->AssignTo(&last_sent_frame_);
++num_sent_frames_;
PostSwapBuffersComplete();
- DidSwapBuffers();
} else {
OutputSurface::SwapBuffers(frame);
frame->AssignTo(&last_sent_frame_);
@@ -70,23 +65,12 @@
void FakeOutputSurface::SetNeedsBeginFrame(bool enable) {
needs_begin_frame_ = enable;
- OutputSurface::SetNeedsBeginFrame(enable);
-
- // If there is not BeginFrame emulation from the FrameRateController,
- // then we just post a BeginFrame to emulate it as part of the test.
- if (enable && !frame_rate_controller_) {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&FakeOutputSurface::OnBeginFrame,
- fake_weak_ptr_factory_.GetWeakPtr()),
- base::TimeDelta::FromMilliseconds(16));
- }
}
-void FakeOutputSurface::OnBeginFrame() {
- OutputSurface::BeginFrame(base::TimeTicks::Now());
+void FakeOutputSurface::BeginFrame(base::TimeTicks frame_time) {
+ client_->BeginFrame(frame_time);
}
-
bool FakeOutputSurface::ForcedDrawToSoftwareDevice() const {
return forced_draw_to_software_device_;
}
« no previous file with comments | « trunk/src/cc/test/fake_output_surface.h ('k') | trunk/src/cc/test/layer_tree_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698