Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) | 275 void TiledLayer::setCanUseLCDText(bool useLCDText) |
|
enne (OOO)
2012/11/14 17:42:15
Where's the invalidation here if this setting chan
alokp
2012/11/16 04:41:11
It was indirectly happening when tile layers were
enne (OOO)
2012/11/16 17:36:38
Ah, great. Thanks for the unit test. :)
| |
| 276 { | 276 { |
| 277 ContentsScalingLayer::setUseLCDText(useLCDText); | 277 ContentsScalingLayer::setCanUseLCDText(useLCDText); |
| 278 | 278 |
| 279 LayerTilingData::BorderTexelOption borderTexelOption; | 279 setBorderTexelOption(useLCDText ? LayerTilingData::NoBorderTexels : LayerTil ingData::HasBorderTexels); |
| 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); | |
| 287 } | 280 } |
| 288 | 281 |
| 289 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect) | 282 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect) |
| 290 { | 283 { |
| 291 updateBounds(); | 284 updateBounds(); |
| 292 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw) | 285 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw) |
| 293 return; | 286 return; |
| 294 | 287 |
| 295 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) { | 288 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) { |
| 296 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second); | 289 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 gfx::Rect prepaintRect = visibleContentRect(); | 760 gfx::Rect prepaintRect = visibleContentRect(); |
| 768 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, | 761 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, |
| 769 -m_tiler->tileSize().height() * prepaintRows); | 762 -m_tiler->tileSize().height() * prepaintRows); |
| 770 gfx::Rect contentRect(gfx::Point(), contentBounds()); | 763 gfx::Rect contentRect(gfx::Point(), contentBounds()); |
| 771 prepaintRect.Intersect(contentRect); | 764 prepaintRect.Intersect(contentRect); |
| 772 | 765 |
| 773 return prepaintRect; | 766 return prepaintRect; |
| 774 } | 767 } |
| 775 | 768 |
| 776 } // namespace cc | 769 } // namespace cc |
| OLD | NEW |