OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 TestContextProvider* context_provider = static_cast<TestContextProvider*>( | 337 TestContextProvider* context_provider = static_cast<TestContextProvider*>( |
338 host_impl->output_surface()->context_provider().get()); | 338 host_impl->output_surface()->context_provider().get()); |
339 | 339 |
340 ++num_activates_; | 340 ++num_activates_; |
341 switch (num_activates_) { | 341 switch (num_activates_) { |
342 case 2: | 342 case 2: |
343 EXPECT_TRUE(delegated_impl->ChildId()); | 343 EXPECT_TRUE(delegated_impl->ChildId()); |
344 EXPECT_FALSE(did_reset_child_id_); | 344 EXPECT_FALSE(did_reset_child_id_); |
345 | 345 |
346 context_provider->TestContext3d()->loseContextCHROMIUM( | 346 context_provider->ContextGL()->LoseContextCHROMIUM( |
347 GL_GUILTY_CONTEXT_RESET_ARB, | 347 GL_GUILTY_CONTEXT_RESET_ARB, |
348 GL_INNOCENT_CONTEXT_RESET_ARB); | 348 GL_INNOCENT_CONTEXT_RESET_ARB); |
| 349 context_provider->ContextGL()->Flush(); |
349 break; | 350 break; |
350 case 3: | 351 case 3: |
351 EXPECT_TRUE(delegated_impl->ChildId()); | 352 EXPECT_TRUE(delegated_impl->ChildId()); |
352 EXPECT_TRUE(did_reset_child_id_); | 353 EXPECT_TRUE(did_reset_child_id_); |
353 EndTest(); | 354 EndTest(); |
354 break; | 355 break; |
355 } | 356 } |
356 } | 357 } |
357 | 358 |
358 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, | 359 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 414 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
414 if (host_impl->active_tree()->source_frame_number() < 1) | 415 if (host_impl->active_tree()->source_frame_number() < 1) |
415 return; | 416 return; |
416 | 417 |
417 TestContextProvider* context_provider = static_cast<TestContextProvider*>( | 418 TestContextProvider* context_provider = static_cast<TestContextProvider*>( |
418 host_impl->output_surface()->context_provider().get()); | 419 host_impl->output_surface()->context_provider().get()); |
419 | 420 |
420 ++num_activates_; | 421 ++num_activates_; |
421 switch (num_activates_) { | 422 switch (num_activates_) { |
422 case 2: | 423 case 2: |
423 context_provider->TestContext3d()->loseContextCHROMIUM( | 424 context_provider->ContextGL()->LoseContextCHROMIUM( |
424 GL_GUILTY_CONTEXT_RESET_ARB, | 425 GL_GUILTY_CONTEXT_RESET_ARB, |
425 GL_INNOCENT_CONTEXT_RESET_ARB); | 426 GL_INNOCENT_CONTEXT_RESET_ARB); |
426 break; | 427 break; |
427 case 3: | 428 case 3: |
428 EndTest(); | 429 EndTest(); |
429 break; | 430 break; |
430 } | 431 } |
431 } | 432 } |
432 | 433 |
433 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, | 434 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2359 } | 2360 } |
2360 | 2361 |
2361 scoped_refptr<DelegatedRendererLayer> delegated_thief_; | 2362 scoped_refptr<DelegatedRendererLayer> delegated_thief_; |
2362 }; | 2363 }; |
2363 | 2364 |
2364 SINGLE_AND_MULTI_THREAD_TEST_F( | 2365 SINGLE_AND_MULTI_THREAD_TEST_F( |
2365 LayerTreeHostDelegatedTestRemoveAndChangeResources); | 2366 LayerTreeHostDelegatedTestRemoveAndChangeResources); |
2366 | 2367 |
2367 } // namespace | 2368 } // namespace |
2368 } // namespace cc | 2369 } // namespace cc |
OLD | NEW |