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

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

Issue 11418040: gfx::Transform API clean-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 900
901 // So should setting the opacity back. 901 // So should setting the opacity back.
902 observer.Reset(); 902 observer.Reset();
903 l2->SetOpacity(1.0f); 903 l2->SetOpacity(1.0f);
904 RunPendingMessages(); 904 RunPendingMessages();
905 EXPECT_TRUE(observer.notified()); 905 EXPECT_TRUE(observer.notified());
906 906
907 // Setting the transform of a layer should alert the observers. 907 // Setting the transform of a layer should alert the observers.
908 observer.Reset(); 908 observer.Reset();
909 gfx::Transform transform; 909 gfx::Transform transform;
910 transform.ConcatTranslate(-200, -200); 910 transform.Translate(200.0, 200.0);
911 transform.ConcatRotate(90.0f); 911 transform.Rotate(90.0);
912 transform.ConcatTranslate(200, 200); 912 transform.Translate(-200.0, -200.0);
913 l2->SetTransform(transform); 913 l2->SetTransform(transform);
914 RunPendingMessages(); 914 RunPendingMessages();
915 EXPECT_TRUE(observer.notified()); 915 EXPECT_TRUE(observer.notified());
916 916
917 // A change resulting in an aborted swap buffer should alert the observer 917 // A change resulting in an aborted swap buffer should alert the observer
918 // and also signal an abort. 918 // and also signal an abort.
919 observer.Reset(); 919 observer.Reset();
920 l2->SetOpacity(0.1f); 920 l2->SetOpacity(0.1f);
921 GetCompositor()->OnSwapBuffersAborted(); 921 GetCompositor()->OnSwapBuffersAborted();
922 RunPendingMessages(); 922 RunPendingMessages();
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 1296
1297 // Resize layer. 1297 // Resize layer.
1298 child->SetBounds(gfx::Rect(200, 200, 400, 400)); 1298 child->SetBounds(gfx::Rect(200, 200, 400, 400));
1299 child->SetVisible(true); 1299 child->SetVisible(true);
1300 EXPECT_TRUE(schedule_draw_invoked_); 1300 EXPECT_TRUE(schedule_draw_invoked_);
1301 DrawTree(root.get()); 1301 DrawTree(root.get());
1302 EXPECT_TRUE(delegate.painted()); 1302 EXPECT_TRUE(delegate.painted());
1303 } 1303 }
1304 1304
1305 } // namespace ui 1305 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698