Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1317743002: cc: Implement shared worker contexts. (v1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: surfaces_context_provider fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after
1606 return settings_.gpu_rasterization_msaa_sample_count; 1606 return settings_.gpu_rasterization_msaa_sample_count;
1607 } 1607 }
1608 1608
1609 bool LayerTreeHostImpl::CanUseGpuRasterization() { 1609 bool LayerTreeHostImpl::CanUseGpuRasterization() {
1610 if (!(output_surface_ && output_surface_->context_provider() && 1610 if (!(output_surface_ && output_surface_->context_provider() &&
1611 output_surface_->worker_context_provider())) 1611 output_surface_->worker_context_provider()))
1612 return false; 1612 return false;
1613 1613
1614 ContextProvider* context_provider = 1614 ContextProvider* context_provider =
1615 output_surface_->worker_context_provider(); 1615 output_surface_->worker_context_provider();
1616 base::AutoLock context_lock(*context_provider->GetLock()); 1616 ContextProvider::ScopedContextLock scoped_context(context_provider);
1617 if (context_provider->HasBeenDestroyed())
1618 return false;
1617 if (!context_provider->GrContext()) 1619 if (!context_provider->GrContext())
1618 return false; 1620 return false;
1619 1621
1620 return true; 1622 return true;
1621 } 1623 }
1622 1624
1623 void LayerTreeHostImpl::UpdateGpuRasterizationStatus() { 1625 void LayerTreeHostImpl::UpdateGpuRasterizationStatus() {
1624 bool use_gpu = false; 1626 bool use_gpu = false;
1625 bool use_msaa = false; 1627 bool use_msaa = false;
1626 bool using_msaa_for_complex_content = 1628 bool using_msaa_for_complex_content =
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after
3598 if (active_tree()) { 3600 if (active_tree()) {
3599 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); 3601 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id);
3600 if (layer) 3602 if (layer)
3601 return layer->ScrollOffsetForAnimation(); 3603 return layer->ScrollOffsetForAnimation();
3602 } 3604 }
3603 3605
3604 return gfx::ScrollOffset(); 3606 return gfx::ScrollOffset();
3605 } 3607 }
3606 3608
3607 } // namespace cc 3609 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698