Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2105 EXPECT_TRUE(view_->last_copy_request_); | 2105 EXPECT_TRUE(view_->last_copy_request_); |
| 2106 EXPECT_TRUE(view_->last_copy_request_->has_texture_mailbox()); | 2106 EXPECT_TRUE(view_->last_copy_request_->has_texture_mailbox()); |
| 2107 request = view_->last_copy_request_.Pass(); | 2107 request = view_->last_copy_request_.Pass(); |
| 2108 | 2108 |
| 2109 // Send back the mailbox included in the request. There's no release callback | 2109 // Send back the mailbox included in the request. There's no release callback |
| 2110 // since the mailbox came from the RWHVA originally. | 2110 // since the mailbox came from the RWHVA originally. |
| 2111 request->SendTextureResult(view_rect.size(), | 2111 request->SendTextureResult(view_rect.size(), |
| 2112 request->texture_mailbox(), | 2112 request->texture_mailbox(), |
| 2113 scoped_ptr<cc::SingleReleaseCallback>()); | 2113 scoped_ptr<cc::SingleReleaseCallback>()); |
| 2114 | 2114 |
| 2115 // This runs until the callback happens. | 2115 // Simulate a composite by running the loop and then notifying |
|
danakj
2015/03/09 22:20:15
Can you maybe add a test here that shows de-duping
miu
2015/03/10 02:50:43
Done.
| |
| 2116 // DelegatedFrameHost that the graphics commands were issued. The latter is | |
| 2117 // required to clear the "frame subscriber de-duping" flag. | |
| 2116 run_loop.Run(); | 2118 run_loop.Run(); |
| 2119 view_->GetDelegatedFrameHost()->OnCompositingStarted(nullptr, | |
|
danakj
2015/03/09 22:20:15
Maybe you should OnCompositingEnded() here too, yo
miu
2015/03/10 02:50:43
Done.
| |
| 2120 base::TimeTicks::Now()); | |
| 2117 | 2121 |
| 2118 // The callback should succeed. | 2122 // The callback should succeed. |
| 2119 EXPECT_EQ(1, callback_count_); | 2123 EXPECT_EQ(1, callback_count_); |
| 2120 EXPECT_TRUE(result_); | 2124 EXPECT_TRUE(result_); |
| 2121 | 2125 |
| 2122 view_->OnSwapCompositorFrame( | 2126 view_->OnSwapCompositorFrame( |
| 2123 1, MakeDelegatedFrame(1.f, view_rect.size(), gfx::Rect(view_rect))); | 2127 1, MakeDelegatedFrame(1.f, view_rect.size(), gfx::Rect(view_rect))); |
| 2124 | 2128 |
| 2125 EXPECT_EQ(1, callback_count_); | 2129 EXPECT_EQ(1, callback_count_); |
| 2126 request = view_->last_copy_request_.Pass(); | 2130 request = view_->last_copy_request_.Pass(); |
| (...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3216 ui::TouchEvent press2( | 3220 ui::TouchEvent press2( |
| 3217 ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), 1, ui::EventTimeForNow()); | 3221 ui::ET_TOUCH_PRESSED, gfx::Point(20, 20), 1, ui::EventTimeForNow()); |
| 3218 view_->OnTouchEvent(&press2); | 3222 view_->OnTouchEvent(&press2); |
| 3219 SendInputEventACK(blink::WebInputEvent::TouchStart, | 3223 SendInputEventACK(blink::WebInputEvent::TouchStart, |
| 3220 INPUT_EVENT_ACK_STATE_CONSUMED); | 3224 INPUT_EVENT_ACK_STATE_CONSUMED); |
| 3221 | 3225 |
| 3222 EXPECT_EQ(2U, view_->dispatcher_->processed_touch_event_count()); | 3226 EXPECT_EQ(2U, view_->dispatcher_->processed_touch_event_count()); |
| 3223 } | 3227 } |
| 3224 | 3228 |
| 3225 } // namespace content | 3229 } // namespace content |
| OLD | NEW |