| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <map> | 5 #include <map> |
| 6 #include <queue> | 6 #include <queue> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/browser_view_renderer.h" | 9 #include "android_webview/browser/browser_view_renderer.h" |
| 10 #include "android_webview/browser/child_frame.h" | 10 #include "android_webview/browser/child_frame.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const ParentCompositorDrawConstraints& constraints1, | 116 const ParentCompositorDrawConstraints& constraints1, |
| 117 const ParentCompositorDrawConstraints& constraints2) { | 117 const ParentCompositorDrawConstraints& constraints2) { |
| 118 if (constraints1.is_layer != constraints2.is_layer || | 118 if (constraints1.is_layer != constraints2.is_layer || |
| 119 constraints1.transform != constraints2.transform) | 119 constraints1.transform != constraints2.transform) |
| 120 return false; | 120 return false; |
| 121 | 121 |
| 122 return !constraints1.is_layer || | 122 return !constraints1.is_layer || |
| 123 constraints1.surface_rect_empty == constraints2.surface_rect_empty; | 123 constraints1.surface_rect_empty == constraints2.surface_rect_empty; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ParentDrawConstraintsUpdated( | 126 void OnParentDrawConstraintsUpdated() override { |
| 127 const ParentCompositorDrawConstraints& constraints) override { | 127 RenderingTest::OnParentDrawConstraintsUpdated(); |
| 128 ParentCompositorDrawConstraints constraints = |
| 129 shared_renderer_state_->GetParentDrawConstraintsOnUI(); |
| 128 switch (on_draw_count_) { | 130 switch (on_draw_count_) { |
| 129 case 1u: | 131 case 1u: |
| 130 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_)); | 132 EXPECT_TRUE(DrawConstraintsEquals(constraints, new_constraints_)); |
| 131 break; | 133 break; |
| 132 case 3u: | 134 case 3u: |
| 133 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_)); | 135 EXPECT_TRUE(DrawConstraintsEquals(constraints, initial_constraints_)); |
| 134 EndTest(); | 136 EndTest(); |
| 135 break; | 137 break; |
| 136 // There will be a following 4th onDraw. But the hardware renderer won't | 138 // There will be a following 4th onDraw. But the hardware renderer won't |
| 137 // post back the draw constraints in DrawGL because the constraints | 139 // post back the draw constraints in DrawGL because the constraints |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 279 |
| 278 private: | 280 private: |
| 279 std::queue<content::SynchronousCompositor::Frame> frames_; | 281 std::queue<content::SynchronousCompositor::Frame> frames_; |
| 280 uint32_t last_output_surface_id_; | 282 uint32_t last_output_surface_id_; |
| 281 std::map<cc::ResourceId, int> expected_return_count_; | 283 std::map<cc::ResourceId, int> expected_return_count_; |
| 282 }; | 284 }; |
| 283 | 285 |
| 284 RENDERING_TEST_F(SwitchOutputSurfaceIdTest); | 286 RENDERING_TEST_F(SwitchOutputSurfaceIdTest); |
| 285 | 287 |
| 286 } // namespace android_webview | 288 } // namespace android_webview |
| OLD | NEW |