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

Side by Side Diff: cc/CCLayerTreeHost.cpp

Issue 10914327: Make cc's use of WTF::HashMap robust to key/value change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/CCLayerTilingData.cpp ('k') | cc/CCLayerTreeHostImpl.cpp » ('j') | no next file with comments »
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 "config.h" 5 #include "config.h"
6 6
7 #include "CCLayerTreeHost.h" 7 #include "CCLayerTreeHost.h"
8 8
9 #include "CCFontAtlas.h" 9 #include "CCFontAtlas.h"
10 #include "CCGraphicsContext.h" 10 #include "CCGraphicsContext.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (m_rootLayer) 92 if (m_rootLayer)
93 m_rootLayer->setLayerTreeHost(0); 93 m_rootLayer->setLayerTreeHost(0);
94 ASSERT(CCProxy::isMainThread()); 94 ASSERT(CCProxy::isMainThread());
95 TRACE_EVENT0("cc", "CCLayerTreeHost::~CCLayerTreeHost"); 95 TRACE_EVENT0("cc", "CCLayerTreeHost::~CCLayerTreeHost");
96 ASSERT(m_proxy); 96 ASSERT(m_proxy);
97 m_proxy->stop(); 97 m_proxy->stop();
98 m_proxy.clear(); 98 m_proxy.clear();
99 numLayerTreeInstances--; 99 numLayerTreeInstances--;
100 RateLimiterMap::iterator it = m_rateLimiters.begin(); 100 RateLimiterMap::iterator it = m_rateLimiters.begin();
101 if (it != m_rateLimiters.end()) 101 if (it != m_rateLimiters.end())
102 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
103 it->value->stop();
104 #else
102 it->second->stop(); 105 it->second->stop();
106 #endif
103 } 107 }
104 108
105 void CCLayerTreeHost::setSurfaceReady() 109 void CCLayerTreeHost::setSurfaceReady()
106 { 110 {
107 m_proxy->setSurfaceReady(); 111 m_proxy->setSurfaceReady();
108 } 112 }
109 113
110 void CCLayerTreeHost::initializeRenderer() 114 void CCLayerTreeHost::initializeRenderer()
111 { 115 {
112 TRACE_EVENT0("cc", "CCLayerTreeHost::initializeRenderer"); 116 TRACE_EVENT0("cc", "CCLayerTreeHost::initializeRenderer");
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 } 682 }
679 683
680 void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) 684 void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context)
681 { 685 {
682 if (m_animating) 686 if (m_animating)
683 return; 687 return;
684 688
685 ASSERT(context); 689 ASSERT(context);
686 RateLimiterMap::iterator it = m_rateLimiters.find(context); 690 RateLimiterMap::iterator it = m_rateLimiters.find(context);
687 if (it != m_rateLimiters.end()) 691 if (it != m_rateLimiters.end())
692 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
693 it->value->start();
694 #else
688 it->second->start(); 695 it->second->start();
696 #endif
689 else { 697 else {
690 RefPtr<RateLimiter> rateLimiter = RateLimiter::create(context, this); 698 RefPtr<RateLimiter> rateLimiter = RateLimiter::create(context, this);
691 m_rateLimiters.set(context, rateLimiter); 699 m_rateLimiters.set(context, rateLimiter);
692 rateLimiter->start(); 700 rateLimiter->start();
693 } 701 }
694 } 702 }
695 703
696 void CCLayerTreeHost::stopRateLimiter(WebKit::WebGraphicsContext3D* context) 704 void CCLayerTreeHost::stopRateLimiter(WebKit::WebGraphicsContext3D* context)
697 { 705 {
698 RateLimiterMap::iterator it = m_rateLimiters.find(context); 706 RateLimiterMap::iterator it = m_rateLimiters.find(context);
699 if (it != m_rateLimiters.end()) { 707 if (it != m_rateLimiters.end()) {
708 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
709 it->value->stop();
710 #else
700 it->second->stop(); 711 it->second->stop();
712 #endif
701 m_rateLimiters.remove(it); 713 m_rateLimiters.remove(it);
702 } 714 }
703 } 715 }
704 716
705 void CCLayerTreeHost::rateLimit() 717 void CCLayerTreeHost::rateLimit()
706 { 718 {
707 // Force a no-op command on the compositor context, so that any ratelimiting commands will wait for the compositing 719 // Force a no-op command on the compositor context, so that any ratelimiting commands will wait for the compositing
708 // context, and therefore for the SwapBuffers. 720 // context, and therefore for the SwapBuffers.
709 m_proxy->forceSerializeOnSwapBuffers(); 721 m_proxy->forceSerializeOnSwapBuffers();
710 } 722 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 else 791 else
780 layer->notifyAnimationFinished(wallClockTime); 792 layer->notifyAnimationFinished(wallClockTime);
781 } 793 }
782 } 794 }
783 795
784 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) 796 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex)
785 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); 797 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
786 } 798 }
787 799
788 } // namespace cc 800 } // namespace cc
OLDNEW
« no previous file with comments | « cc/CCLayerTilingData.cpp ('k') | cc/CCLayerTreeHostImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698