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

Side by Side Diff: cc/CCDirectRenderer.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/CCDamageTracker.cpp ('k') | cc/CCLayerTilingData.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "CCDirectRenderer.h" 7 #include "CCDirectRenderer.h"
8 8
9 #include "CCMathUtil.h" 9 #include "CCMathUtil.h"
10 #include <public/WebTransformationMatrix.h> 10 #include <public/WebTransformationMatrix.h>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 void CCDirectRenderer::decideRenderPassAllocationsForFrame(const CCRenderPassLis t& renderPassesInDrawOrder) 92 void CCDirectRenderer::decideRenderPassAllocationsForFrame(const CCRenderPassLis t& renderPassesInDrawOrder)
93 { 93 {
94 HashMap<CCRenderPass::Id, const CCRenderPass*> renderPassesInFrame; 94 HashMap<CCRenderPass::Id, const CCRenderPass*> renderPassesInFrame;
95 for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i) 95 for (size_t i = 0; i < renderPassesInDrawOrder.size(); ++i)
96 renderPassesInFrame.set(renderPassesInDrawOrder[i]->id(), renderPassesIn DrawOrder[i]); 96 renderPassesInFrame.set(renderPassesInDrawOrder[i]->id(), renderPassesIn DrawOrder[i]);
97 97
98 Vector<CCRenderPass::Id> passesToDelete; 98 Vector<CCRenderPass::Id> passesToDelete;
99 HashMap<CCRenderPass::Id, OwnPtr<CachedTexture> >::const_iterator passIterat or; 99 HashMap<CCRenderPass::Id, OwnPtr<CachedTexture> >::const_iterator passIterat or;
100 for (passIterator = m_renderPassTextures.begin(); passIterator != m_renderPa ssTextures.end(); ++passIterator) { 100 for (passIterator = m_renderPassTextures.begin(); passIterator != m_renderPa ssTextures.end(); ++passIterator) {
101 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
102 const CCRenderPass* renderPassInFrame = renderPassesInFrame.get(passIter ator->key);
103 #else
101 const CCRenderPass* renderPassInFrame = renderPassesInFrame.get(passIter ator->first); 104 const CCRenderPass* renderPassInFrame = renderPassesInFrame.get(passIter ator->first);
105 #endif
102 if (!renderPassInFrame) { 106 if (!renderPassInFrame) {
107 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
108 passesToDelete.append(passIterator->key);
109 #else
103 passesToDelete.append(passIterator->first); 110 passesToDelete.append(passIterator->first);
111 #endif
104 continue; 112 continue;
105 } 113 }
106 114
107 const IntSize& requiredSize = renderPassTextureSize(renderPassInFrame); 115 const IntSize& requiredSize = renderPassTextureSize(renderPassInFrame);
108 GC3Denum requiredFormat = renderPassTextureFormat(renderPassInFrame); 116 GC3Denum requiredFormat = renderPassTextureFormat(renderPassInFrame);
117 #if WTF_NEW_HASHMAP_ITERATORS_INTERFACE
118 CachedTexture* texture = passIterator->value.get();
119 #else
109 CachedTexture* texture = passIterator->second.get(); 120 CachedTexture* texture = passIterator->second.get();
121 #endif
110 ASSERT(texture); 122 ASSERT(texture);
111 123
112 if (texture->id() && (texture->size() != requiredSize || texture->format () != requiredFormat)) 124 if (texture->id() && (texture->size() != requiredSize || texture->format () != requiredFormat))
113 texture->free(); 125 texture->free();
114 } 126 }
115 127
116 // Delete RenderPass textures from the previous frame that will not be used again. 128 // Delete RenderPass textures from the previous frame that will not be used again.
117 for (size_t i = 0; i < passesToDelete.size(); ++i) 129 for (size_t i = 0; i < passesToDelete.size(); ++i)
118 m_renderPassTextures.remove(passesToDelete[i]); 130 m_renderPassTextures.remove(passesToDelete[i]);
119 131
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 return pass->outputRect().size(); 215 return pass->outputRect().size();
204 } 216 }
205 217
206 // static 218 // static
207 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*) 219 GC3Denum CCDirectRenderer::renderPassTextureFormat(const CCRenderPass*)
208 { 220 {
209 return GraphicsContext3D::RGBA; 221 return GraphicsContext3D::RGBA;
210 } 222 }
211 223
212 } 224 }
OLDNEW
« no previous file with comments | « cc/CCDamageTracker.cpp ('k') | cc/CCLayerTilingData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698