| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "cc/trees/layer_tree_host_impl.h" | 44 #include "cc/trees/layer_tree_host_impl.h" |
| 45 #include "cc/trees/layer_tree_impl.h" | 45 #include "cc/trees/layer_tree_impl.h" |
| 46 #include "cc/trees/single_thread_proxy.h" | 46 #include "cc/trees/single_thread_proxy.h" |
| 47 #include "cc/trees/thread_proxy.h" | 47 #include "cc/trees/thread_proxy.h" |
| 48 #include "gpu/GLES2/gl2extchromium.h" | 48 #include "gpu/GLES2/gl2extchromium.h" |
| 49 #include "skia/ext/refptr.h" | 49 #include "skia/ext/refptr.h" |
| 50 #include "testing/gmock/include/gmock/gmock.h" | 50 #include "testing/gmock/include/gmock/gmock.h" |
| 51 #include "third_party/khronos/GLES2/gl2.h" | 51 #include "third_party/khronos/GLES2/gl2.h" |
| 52 #include "third_party/khronos/GLES2/gl2ext.h" | 52 #include "third_party/khronos/GLES2/gl2ext.h" |
| 53 #include "third_party/skia/include/core/SkPicture.h" | 53 #include "third_party/skia/include/core/SkPicture.h" |
| 54 #include "ui/gfx/frame_time.h" |
| 54 #include "ui/gfx/point_conversions.h" | 55 #include "ui/gfx/point_conversions.h" |
| 55 #include "ui/gfx/size_conversions.h" | 56 #include "ui/gfx/size_conversions.h" |
| 56 #include "ui/gfx/vector2d_conversions.h" | 57 #include "ui/gfx/vector2d_conversions.h" |
| 57 | 58 |
| 58 using testing::_; | 59 using testing::_; |
| 59 using testing::AnyNumber; | 60 using testing::AnyNumber; |
| 60 using testing::AtLeast; | 61 using testing::AtLeast; |
| 61 using testing::Mock; | 62 using testing::Mock; |
| 62 | 63 |
| 63 namespace cc { | 64 namespace cc { |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 | 998 |
| 998 PostSetNeedsCommitToMainThread(); | 999 PostSetNeedsCommitToMainThread(); |
| 999 } | 1000 } |
| 1000 | 1001 |
| 1001 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1002 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
| 1002 frame_++; | 1003 frame_++; |
| 1003 if (frame_ == 1) { | 1004 if (frame_ == 1) { |
| 1004 first_frame_time_ = impl->CurrentFrameTimeTicks(); | 1005 first_frame_time_ = impl->CurrentFrameTimeTicks(); |
| 1005 impl->SetNeedsRedraw(); | 1006 impl->SetNeedsRedraw(); |
| 1006 | 1007 |
| 1007 // Since base::TimeTicks::Now() uses a low-resolution clock on | 1008 // Since we might use a low-resolution clock on Windows, we need to |
| 1008 // Windows, we need to make sure that the clock has incremented past | 1009 // make sure that the clock has incremented past first_frame_time_. |
| 1009 // first_frame_time_. | 1010 while (first_frame_time_ == gfx::FrameTime::Now()) {} |
| 1010 while (first_frame_time_ == base::TimeTicks::Now()) {} | |
| 1011 | 1011 |
| 1012 return; | 1012 return; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 EXPECT_NE(first_frame_time_, impl->CurrentFrameTimeTicks()); | 1015 EXPECT_NE(first_frame_time_, impl->CurrentFrameTimeTicks()); |
| 1016 EndTest(); | 1016 EndTest(); |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 1019 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
| 1020 // Ensure there isn't a commit between the two draws, to ensure that a | 1020 // Ensure there isn't a commit between the two draws, to ensure that a |
| (...skipping 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5101 size_t second_output_surface_memory_limit_; | 5101 size_t second_output_surface_memory_limit_; |
| 5102 FakeContentLayerClient client_; | 5102 FakeContentLayerClient client_; |
| 5103 scoped_refptr<FakeContentLayer> root_; | 5103 scoped_refptr<FakeContentLayer> root_; |
| 5104 }; | 5104 }; |
| 5105 | 5105 |
| 5106 // No output to copy for delegated renderers. | 5106 // No output to copy for delegated renderers. |
| 5107 SINGLE_AND_MULTI_THREAD_TEST_F( | 5107 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 5108 LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface); | 5108 LayerTreeHostTestSetMemoryPolicyOnLostOutputSurface); |
| 5109 | 5109 |
| 5110 } // namespace cc | 5110 } // namespace cc |
| OLD | NEW |