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

Side by Side Diff: cc/damage_tracker.cc

Issue 11550035: Implement pinch-zoom scaling for main-frame scrollbars and pinch-zoom overlay scrollbars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor for cleaner state/scrollbar split. 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 | « cc/cc.gyp ('k') | cc/layer_impl.h » ('j') | cc/layer_impl.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/damage_tracker.h" 5 #include "cc/damage_tracker.h"
6 6
7 #include "cc/layer_impl.h" 7 #include "cc/layer_impl.h"
8 #include "cc/layer_tree_host_common.h" 8 #include "cc/layer_tree_host_common.h"
9 #include "cc/math_util.h" 9 #include "cc/math_util.h"
10 #include "cc/render_surface_impl.h" 10 #include "cc/render_surface_impl.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return gfx::RectF(); 155 return gfx::RectF();
156 156
157 gfx::RectF ret = iter->second; 157 gfx::RectF ret = iter->second;
158 m_currentRectHistory->erase(iter); 158 m_currentRectHistory->erase(iter);
159 return ret; 159 return ret;
160 } 160 }
161 161
162 void DamageTracker::saveRectForNextFrame(int layerID, const gfx::RectF& targetSp aceRect) 162 void DamageTracker::saveRectForNextFrame(int layerID, const gfx::RectF& targetSp aceRect)
163 { 163 {
164 // This layer should not yet exist in next frame's history. 164 // This layer should not yet exist in next frame's history.
165 DCHECK(layerID > 0); 165 DCHECK(layerID > 0 || layerID == -1 || layerID == -2);
Ian Vollick 2013/01/15 20:33:48 I'll make a more detailed proposal about how to ha
166 DCHECK(m_nextRectHistory->find(layerID) == m_nextRectHistory->end()); 166 DCHECK(m_nextRectHistory->find(layerID) == m_nextRectHistory->end());
167 (*m_nextRectHistory)[layerID] = targetSpaceRect; 167 (*m_nextRectHistory)[layerID] = targetSpaceRect;
168 } 168 }
169 169
170 gfx::RectF DamageTracker::trackDamageFromActiveLayers(const std::vector<LayerImp l*>& layerList, int targetSurfaceLayerID) 170 gfx::RectF DamageTracker::trackDamageFromActiveLayers(const std::vector<LayerImp l*>& layerList, int targetSurfaceLayerID)
171 { 171 {
172 gfx::RectF damageRect = gfx::RectF(); 172 gfx::RectF damageRect = gfx::RectF();
173 173
174 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) { 174 for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
175 // Visit layers in back-to-front order. 175 // Visit layers in back-to-front order.
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // If the layer has a background filter, this may cause pixels in our surfac e to be expanded, so we will need to expand any damage 333 // If the layer has a background filter, this may cause pixels in our surfac e to be expanded, so we will need to expand any damage
334 // at or below this layer. We expand the damage from this layer too, as we n eed to readback those pixels from the surface with only 334 // at or below this layer. We expand the damage from this layer too, as we n eed to readback those pixels from the surface with only
335 // the contents of layers below this one in them. This means we need to redr aw any pixels in the surface being used for the blur in 335 // the contents of layers below this one in them. This means we need to redr aw any pixels in the surface being used for the blur in
336 // this layer this frame. 336 // this layer this frame.
337 if (layer->backgroundFilters().hasFilterThatMovesPixels()) 337 if (layer->backgroundFilters().hasFilterThatMovesPixels())
338 expandDamageRectInsideRectWithFilters(targetDamageRect, surfaceRectInTar getSpace, layer->backgroundFilters()); 338 expandDamageRectInsideRectWithFilters(targetDamageRect, surfaceRectInTar getSpace, layer->backgroundFilters());
339 } 339 }
340 340
341 } // namespace cc 341 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layer_impl.h » ('j') | cc/layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698