| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/delegated_frame_provider.h" | 9 #include "cc/layers/delegated_frame_provider.h" |
| 10 #include "cc/layers/delegated_frame_resource_collection.h" | 10 #include "cc/layers/delegated_frame_resource_collection.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 if (delegating_renderer()) | 100 if (delegating_renderer()) |
| 101 return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); | 101 return FakeOutputSurface::CreateDelegating3d(context3d.Pass()); |
| 102 else | 102 else |
| 103 return FakeOutputSurface::Create3d(context3d.Pass()); | 103 return FakeOutputSurface::Create3d(context3d.Pass()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 virtual DrawResult PrepareToDrawOnThread( | 106 virtual DrawResult PrepareToDrawOnThread( |
| 107 LayerTreeHostImpl* host_impl, | 107 LayerTreeHostImpl* host_impl, |
| 108 LayerTreeHostImpl::FrameData* frame, | 108 LayerTreeHostImpl::FrameData* frame, |
| 109 DrawResult draw_result) OVERRIDE { | 109 DrawResult draw_result) OVERRIDE { |
| 110 if (draw_result == DRAW_ABORTED_MISSING_HIGH_RES_CONTENT) { |
| 111 // Only valid for single-threaded impl-side painting, which activates |
| 112 // immediately and will try to draw again when content has finished. |
| 113 DCHECK(!host_impl->proxy()->HasImplThread()); |
| 114 DCHECK(layer_tree_host()->settings().impl_side_painting); |
| 115 return draw_result; |
| 116 } |
| 110 EXPECT_EQ(DRAW_SUCCESS, draw_result); | 117 EXPECT_EQ(DRAW_SUCCESS, draw_result); |
| 111 if (!times_to_lose_during_draw_) | 118 if (!times_to_lose_during_draw_) |
| 112 return draw_result; | 119 return draw_result; |
| 113 | 120 |
| 114 --times_to_lose_during_draw_; | 121 --times_to_lose_during_draw_; |
| 115 LoseContext(); | 122 LoseContext(); |
| 116 | 123 |
| 117 times_to_fail_create_ = times_to_fail_recreate_; | 124 times_to_fail_create_ = times_to_fail_recreate_; |
| 118 times_to_fail_recreate_ = 0; | 125 times_to_fail_recreate_ = 0; |
| 119 | 126 |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 virtual void AfterTest() OVERRIDE {} | 1713 virtual void AfterTest() OVERRIDE {} |
| 1707 | 1714 |
| 1708 bool deferred_; | 1715 bool deferred_; |
| 1709 }; | 1716 }; |
| 1710 | 1717 |
| 1711 SINGLE_AND_MULTI_THREAD_TEST_F( | 1718 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1712 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); | 1719 LayerTreeHostContextTestLoseAfterSendingBeginMainFrame); |
| 1713 | 1720 |
| 1714 } // namespace | 1721 } // namespace |
| 1715 } // namespace cc | 1722 } // namespace cc |
| OLD | NEW |