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

Side by Side Diff: ui/compositor/layer_unittest.cc

Issue 10453117: Tighter sync and faster ACK on SwapBuffers/PostSubBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 302 }
303 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE { 303 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {
304 } 304 }
305 305
306 DISALLOW_COPY_AND_ASSIGN(NullLayerDelegate); 306 DISALLOW_COPY_AND_ASSIGN(NullLayerDelegate);
307 }; 307 };
308 308
309 // Remembers if it has been notified. 309 // Remembers if it has been notified.
310 class TestCompositorObserver : public CompositorObserver { 310 class TestCompositorObserver : public CompositorObserver {
311 public: 311 public:
312 TestCompositorObserver() : started_(false), ended_(false) {} 312 TestCompositorObserver() : started_(false), will_end_(false), ended_(false) {
313 }
313 314
314 bool notified() const { return started_ && ended_; } 315 bool notified() const { return started_ && will_end_ && ended_; }
315 316
316 void Reset() { 317 void Reset() {
317 started_ = false; 318 started_ = false;
319 will_end_ = false;
318 ended_ = false; 320 ended_ = false;
319 } 321 }
320 322
321 private: 323 private:
322 virtual void OnCompositingStarted(Compositor* compositor) OVERRIDE { 324 virtual void OnCompositingStarted(Compositor* compositor) OVERRIDE {
323 started_ = true; 325 started_ = true;
324 } 326 }
325 327
328 virtual void OnCompositingWillEnd(Compositor* compositor) OVERRIDE {
329 will_end_ = true;
330 }
331
326 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE { 332 virtual void OnCompositingEnded(Compositor* compositor) OVERRIDE {
327 ended_ = true; 333 ended_ = true;
328 } 334 }
329 335
330 bool started_; 336 bool started_;
337 bool will_end_;
331 bool ended_; 338 bool ended_;
332 339
333 DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver); 340 DISALLOW_COPY_AND_ASSIGN(TestCompositorObserver);
334 }; 341 };
335 342
336 } // namespace 343 } // namespace
337 344
338 #if defined(OS_WIN) 345 #if defined(OS_WIN)
339 // These are disabled on windows as they don't run correctly on the buildbot. 346 // These are disabled on windows as they don't run correctly on the buildbot.
340 // Reenable once we move to the real compositor. 347 // Reenable once we move to the real compositor.
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 1262
1256 // Resize layer. 1263 // Resize layer.
1257 child->SetBounds(gfx::Rect(200, 200, 400, 400)); 1264 child->SetBounds(gfx::Rect(200, 200, 400, 400));
1258 child->SetVisible(true); 1265 child->SetVisible(true);
1259 EXPECT_TRUE(schedule_draw_invoked_); 1266 EXPECT_TRUE(schedule_draw_invoked_);
1260 DrawTree(root.get()); 1267 DrawTree(root.get());
1261 EXPECT_TRUE(delegate.painted()); 1268 EXPECT_TRUE(delegate.painted());
1262 } 1269 }
1263 1270
1264 } // namespace ui 1271 } // namespace ui
OLDNEW
« ui/compositor/compositor.h ('K') | « ui/compositor/compositor_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698