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