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

Side by Side Diff: cc/tiled_layer.cc

Issue 11360093: Mark layers that can use LCD text based on layer transform and opacity. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed compile error 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
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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "cc/geometry.h" 10 #include "cc/geometry.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 268
269 return addedTile; 269 return addedTile;
270 } 270 }
271 271
272 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect) 272 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect)
273 { 273 {
274 invalidateContentRect(layerRectToContentRect(dirtyRect)); 274 invalidateContentRect(layerRectToContentRect(dirtyRect));
275 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect); 275 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect);
276 } 276 }
277 277
278 void TiledLayer::setUseLCDText(bool useLCDText) 278 void TiledLayer::setCanUseLCDText(bool useLCDText)
279 { 279 {
280 ContentsScalingLayer::setUseLCDText(useLCDText); 280 ContentsScalingLayer::setCanUseLCDText(useLCDText);
281 281
282 LayerTilingData::BorderTexelOption borderTexelOption; 282 setBorderTexelOption(useLCDText ? LayerTilingData::NoBorderTexels : LayerTil ingData::HasBorderTexels);
danakj 2012/11/10 01:12:35 Is this change needed here, since useLCDText shoul
alokp 2012/11/12 01:04:45 Not necessary, but now there is no need for this c
danakj 2012/11/12 01:25:47 Yah, Ok :)
283 #if OS(ANDROID)
284 // Always want border texels and GL_LINEAR due to pinch zoom.
285 borderTexelOption = LayerTilingData::HasBorderTexels;
286 #else
287 borderTexelOption = useLCDText ? LayerTilingData::NoBorderTexels : LayerTili ngData::HasBorderTexels;
288 #endif
289 setBorderTexelOption(borderTexelOption);
290 } 283 }
291 284
292 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect) 285 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect)
293 { 286 {
294 updateBounds(); 287 updateBounds();
295 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw) 288 if (m_tiler->isEmpty() || contentRect.IsEmpty() || m_skipsDraw)
296 return; 289 return;
297 290
298 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) { 291 for (LayerTilingData::TileMap::const_iterator iter = m_tiler->tiles().begin( ); iter != m_tiler->tiles().end(); ++iter) {
299 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second); 292 UpdatableTile* tile = static_cast<UpdatableTile*>(iter->second);
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 gfx::Rect prepaintRect = visibleContentRect(); 769 gfx::Rect prepaintRect = visibleContentRect();
777 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, 770 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns,
778 -m_tiler->tileSize().height() * prepaintRows); 771 -m_tiler->tileSize().height() * prepaintRows);
779 gfx::Rect contentRect(gfx::Point(), contentBounds()); 772 gfx::Rect contentRect(gfx::Point(), contentBounds());
780 prepaintRect.Intersect(contentRect); 773 prepaintRect.Intersect(contentRect);
781 774
782 return prepaintRect; 775 return prepaintRect;
783 } 776 }
784 777
785 } // namespace cc 778 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698