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

Side by Side Diff: cc/tiled_layer.cc

Issue 11360066: cc: Remove WebCore rect use from the compositor, except within Region. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Signs Created 8 years, 1 month 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/test/layer_test_common.cc ('k') | cc/tiled_layer_unittest.cc » ('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 "cc/tiled_layer.h" 7 #include "cc/tiled_layer.h"
8 8
9 #include "Region.h" 9 #include "Region.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 gfx::Size oldBounds = m_tiler->bounds(); 144 gfx::Size oldBounds = m_tiler->bounds();
145 gfx::Size newBounds = contentBounds(); 145 gfx::Size newBounds = contentBounds();
146 if (oldBounds == newBounds) 146 if (oldBounds == newBounds)
147 return; 147 return;
148 m_tiler->setBounds(newBounds); 148 m_tiler->setBounds(newBounds);
149 149
150 // Invalidate any areas that the new bounds exposes. 150 // Invalidate any areas that the new bounds exposes.
151 Region oldRegion = gfx::Rect(gfx::Point(), oldBounds); 151 Region oldRegion = gfx::Rect(gfx::Point(), oldBounds);
152 Region newRegion = gfx::Rect(gfx::Point(), newBounds); 152 Region newRegion = gfx::Rect(gfx::Point(), newBounds);
153 newRegion.Subtract(oldRegion); 153 newRegion.Subtract(oldRegion);
154 Vector<WebCore::IntRect> rects = newRegion.rects(); 154 for (Region::Iterator newRects(newRegion); newRects.has_rect(); newRects.nex t())
155 for (size_t i = 0; i < rects.size(); ++i) 155 invalidateContentRect(newRects.rect());
156 invalidateContentRect(cc::IntRect(rects[i]));
157 } 156 }
158 157
159 void TiledLayer::setTileSize(const gfx::Size& size) 158 void TiledLayer::setTileSize(const gfx::Size& size)
160 { 159 {
161 m_tiler->setTileSize(size); 160 m_tiler->setTileSize(size);
162 } 161 }
163 162
164 void TiledLayer::setBorderTexelOption(LayerTilingData::BorderTexelOption borderT exelOption) 163 void TiledLayer::setBorderTexelOption(LayerTilingData::BorderTexelOption borderT exelOption)
165 { 164 {
166 m_tiler->setBorderTexelOption(borderTexelOption); 165 m_tiler->setBorderTexelOption(borderTexelOption);
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 gfx::Rect prepaintRect = visibleContentRect(); 777 gfx::Rect prepaintRect = visibleContentRect();
779 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, 778 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns,
780 -m_tiler->tileSize().height() * prepaintRows); 779 -m_tiler->tileSize().height() * prepaintRows);
781 gfx::Rect contentRect(gfx::Point(), contentBounds()); 780 gfx::Rect contentRect(gfx::Point(), contentBounds());
782 prepaintRect.Intersect(contentRect); 781 prepaintRect.Intersect(contentRect);
783 782
784 return prepaintRect; 783 return prepaintRect;
785 } 784 }
786 785
787 } 786 }
OLDNEW
« no previous file with comments | « cc/test/layer_test_common.cc ('k') | cc/tiled_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698