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

Side by Side Diff: cc/tiled_layer.cc

Issue 11360205: Always use border texels on layer tiles. We already did that on certain platforms. This patch exten… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/tiled_layer.h ('k') | no next file » | 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 "cc/tiled_layer.h" 5 #include "cc/tiled_layer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/geometry.h" 9 #include "cc/geometry.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 265
266 return addedTile; 266 return addedTile;
267 } 267 }
268 268
269 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect) 269 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect)
270 { 270 {
271 invalidateContentRect(layerRectToContentRect(dirtyRect)); 271 invalidateContentRect(layerRectToContentRect(dirtyRect));
272 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect); 272 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect);
273 } 273 }
274 274
275 void TiledLayer::setUseLCDText(bool useLCDText)
276 {
277 ContentsScalingLayer::setUseLCDText(useLCDText);
278
279 LayerTilingData::BorderTexelOption borderTexelOption;
280 #if defined(OS_ANDROID)
281 // Always want border texels and GL_LINEAR due to pinch zoom.
282 borderTexelOption = LayerTilingData::HasBorderTexels;
283 #else
284 borderTexelOption = useLCDText ? LayerTilingData::NoBorderTexels : LayerTili ngData::HasBorderTexels;
285 #endif
286 setBorderTexelOption(borderTexelOption);
jamesr 2012/11/12 23:42:25 If you're ripping this out then a lot of other cod
287 }
288
289 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect) 275 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect)
290 { 276 {
291 updateBounds(); 277 updateBounds();
292 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw) 278 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw)
293 return; 279 return;
294 280
295 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) { 281 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) {
296 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second); 282 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
297 DCHECK(tile); 283 DCHECK(tile);
298 // FIXME: This should not ever be null. 284 // FIXME: This should not ever be null.
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 gfx::Rect prepaintRect = visibleContentRect(); 753 gfx::Rect prepaintRect = visibleContentRect();
768 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, 754 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns,
769 -m_tiler->tileSize().height() * prepaintRows); 755 -m_tiler->tileSize().height() * prepaintRows);
770 gfx::Rect contentRect(gfx::Point(), contentBounds()); 756 gfx::Rect contentRect(gfx::Point(), contentBounds());
771 prepaintRect.Intersect(contentRect); 757 prepaintRect.Intersect(contentRect);
772 758
773 return prepaintRect; 759 return prepaintRect;
774 } 760 }
775 761
776 } // namespace cc 762 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiled_layer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698