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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11883030: cc: Fix lost context handling when using impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/picture_layer_impl.h » ('j') | cc/tile_manager.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
964 bool LayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputSurfa ce) 964 bool LayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputSurfa ce)
965 { 965 {
966 // Since we will create a new resource provider, we cannot continue to use 966 // Since we will create a new resource provider, we cannot continue to use
967 // the old resources (i.e. renderSurfaces and texture IDs). Clear them 967 // the old resources (i.e. renderSurfaces and texture IDs). Clear them
968 // before we destroy the old resource provider. 968 // before we destroy the old resource provider.
969 if (rootLayer()) { 969 if (rootLayer()) {
970 clearRenderSurfaces(); 970 clearRenderSurfaces();
971 sendDidLoseOutputSurfaceRecursive(rootLayer()); 971 sendDidLoseOutputSurfaceRecursive(rootLayer());
972 } 972 }
973 // Note: order is important here. 973 // Note: order is important here.
974 m_pendingTree.reset();
enne (OOO) 2013/01/15 03:36:25 You should apply the if statement above on line 96
reveman 2013/01/15 04:05:13 Done.
974 m_renderer.reset(); 975 m_renderer.reset();
975 m_tileManager.reset(); 976 m_tileManager.reset();
976 m_resourceProvider.reset(); 977 m_resourceProvider.reset();
977 m_outputSurface.reset(); 978 m_outputSurface.reset();
978 979
979 if (!outputSurface->BindToClient(this)) 980 if (!outputSurface->BindToClient(this))
980 return false; 981 return false;
981 982
982 scoped_ptr<ResourceProvider> resourceProvider = ResourceProvider::create(out putSurface.get()); 983 scoped_ptr<ResourceProvider> resourceProvider = ResourceProvider::create(out putSurface.get());
983 if (!resourceProvider) 984 if (!resourceProvider)
(...skipping 12 matching lines...) Expand all
996 return false; 997 return false;
997 998
998 setNeedsUpdateDrawProperties(); 999 setNeedsUpdateDrawProperties();
999 m_resourceProvider = resourceProvider.Pass(); 1000 m_resourceProvider = resourceProvider.Pass();
1000 m_outputSurface = outputSurface.Pass(); 1001 m_outputSurface = outputSurface.Pass();
1001 1002
1002 if (!m_visible) 1003 if (!m_visible)
1003 m_renderer->setVisible(m_visible); 1004 m_renderer->setVisible(m_visible);
1004 1005
1005 m_client->onCanDrawStateChanged(canDraw()); 1006 m_client->onCanDrawStateChanged(canDraw());
1007 m_client->onHasPendingTreeStateChanged(pendingTree());
enne (OOO) 2013/01/15 03:36:25 This can go away too.
reveman 2013/01/15 04:05:13 Done.
1006 1008
1007 return true; 1009 return true;
1008 } 1010 }
1009 1011
1010 void LayerTreeHostImpl::setContentsTexturesPurged() 1012 void LayerTreeHostImpl::setContentsTexturesPurged()
1011 { 1013 {
1012 m_contentsTexturesPurged = true; 1014 m_contentsTexturesPurged = true;
1013 m_client->onCanDrawStateChanged(canDraw()); 1015 m_client->onCanDrawStateChanged(canDraw());
1014 } 1016 }
1015 1017
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1639 } 1641 }
1640 1642
1641 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture() 1643 skia::RefPtr<SkPicture> LayerTreeHostImpl::capturePicture()
1642 { 1644 {
1643 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree(); 1645 LayerTreeImpl* tree = pendingTree() ? pendingTree() : activeTree();
1644 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer()); 1646 LayerImpl* layer = getNonCompositedContentLayerRecursive(tree->RootLayer());
1645 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>(); 1647 return layer ? layer->getPicture() : skia::RefPtr<SkPicture>();
1646 } 1648 }
1647 1649
1648 } // namespace cc 1650 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/picture_layer_impl.h » ('j') | cc/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698