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

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 unit tests 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 "Region.h" 9 #include "Region.h"
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 return addedTile; 270 return addedTile;
271 } 271 }
272 272
273 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect) 273 void TiledLayer::setNeedsDisplayRect(const gfx::RectF& dirtyRect)
274 { 274 {
275 invalidateContentRect(layerRectToContentRect(dirtyRect)); 275 invalidateContentRect(layerRectToContentRect(dirtyRect));
276 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect); 276 ContentsScalingLayer::setNeedsDisplayRect(dirtyRect);
277 } 277 }
278 278
279 void TiledLayer::setUseLCDText(bool useLCDText) 279 void TiledLayer::setCanUseLCDText(bool useLCDText)
280 { 280 {
281 ContentsScalingLayer::setUseLCDText(useLCDText); 281 ContentsScalingLayer::setCanUseLCDText(useLCDText);
282 282
283 LayerTilingData::BorderTexelOption borderTexelOption; 283 LayerTilingData::BorderTexelOption borderTexelOption;
284 #if OS(ANDROID) 284 #if OS(ANDROID)
285 DCHECK(!useLCDText);
danakj 2012/11/07 18:15:00 This won't work well with making it a LayerTreeSet
alokp 2012/11/08 22:34:07 I realized that if-else block is not needed anymor
285 // Always want border texels and GL_LINEAR due to pinch zoom. 286 // Always want border texels and GL_LINEAR due to pinch zoom.
286 borderTexelOption = LayerTilingData::HasBorderTexels; 287 borderTexelOption = LayerTilingData::HasBorderTexels;
287 #else 288 #else
288 borderTexelOption = useLCDText ? LayerTilingData::NoBorderTexels : LayerTili ngData::HasBorderTexels; 289 borderTexelOption = useLCDText ? LayerTilingData::NoBorderTexels : LayerTili ngData::HasBorderTexels;
289 #endif 290 #endif
290 setBorderTexelOption(borderTexelOption); 291 setBorderTexelOption(borderTexelOption);
291 } 292 }
292 293
293 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect) 294 void TiledLayer::invalidateContentRect(const gfx::Rect& contentRect)
294 { 295 {
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 gfx::Rect prepaintRect = visibleContentRect(); 778 gfx::Rect prepaintRect = visibleContentRect();
778 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns, 779 prepaintRect.Inset(-m_tiler->tileSize().width() * prepaintColumns,
779 -m_tiler->tileSize().height() * prepaintRows); 780 -m_tiler->tileSize().height() * prepaintRows);
780 gfx::Rect contentRect(gfx::Point(), contentBounds()); 781 gfx::Rect contentRect(gfx::Point(), contentBounds());
781 prepaintRect.Intersect(contentRect); 782 prepaintRect.Intersect(contentRect);
782 783
783 return prepaintRect; 784 return prepaintRect;
784 } 785 }
785 786
786 } // namespace cc 787 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698