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

Side by Side Diff: cc/layer_tree_host.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: rebase with TOT, addressed comments 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 "cc/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "cc/font_atlas.h" 9 #include "cc/font_atlas.h"
10 #include "cc/graphics_context.h" 10 #include "cc/graphics_context.h"
(...skipping 27 matching lines...) Expand all
38 LayerTreeSettings::LayerTreeSettings() 38 LayerTreeSettings::LayerTreeSettings()
39 : acceleratePainting(false) 39 : acceleratePainting(false)
40 , showPlatformLayerTree(false) 40 , showPlatformLayerTree(false)
41 , showPaintRects(false) 41 , showPaintRects(false)
42 , showPropertyChangedRects(false) 42 , showPropertyChangedRects(false)
43 , showSurfaceDamageRects(false) 43 , showSurfaceDamageRects(false)
44 , showScreenSpaceRects(false) 44 , showScreenSpaceRects(false)
45 , showReplicaScreenSpaceRects(false) 45 , showReplicaScreenSpaceRects(false)
46 , showOccludingRects(false) 46 , showOccludingRects(false)
47 , renderVSyncEnabled(true) 47 , renderVSyncEnabled(true)
48 , canUseLCDText(true)
48 , refreshRate(0) 49 , refreshRate(0)
49 , maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) 50 , maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
50 , defaultTileSize(gfx::Size(256, 256)) 51 , defaultTileSize(gfx::Size(256, 256))
51 , maxUntiledLayerSize(gfx::Size(512, 512)) 52 , maxUntiledLayerSize(gfx::Size(512, 512))
52 , minimumOcclusionTrackingSize(gfx::Size(160, 160)) 53 , minimumOcclusionTrackingSize(gfx::Size(160, 160))
53 { 54 {
55 // FIXME: Remove this hard-coded setting.
56 // Platforms that need to disable LCD text must explicitly set this value.
57 #if defined(OS_ANDROID)
58 canUseLCDText = false;
59 #endif
54 } 60 }
55 61
56 LayerTreeSettings::~LayerTreeSettings() 62 LayerTreeSettings::~LayerTreeSettings()
57 { 63 {
58 } 64 }
59 65
60 RendererCapabilities::RendererCapabilities() 66 RendererCapabilities::RendererCapabilities()
61 : bestTextureFormat(0) 67 : bestTextureFormat(0)
62 , contextHasCachedFrontBuffer(false) 68 , contextHasCachedFrontBuffer(false)
63 , usingPartialSwap(false) 69 , usingPartialSwap(false)
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 LayerList updateList; 545 LayerList updateList;
540 546
541 { 547 {
542 if (Settings::pageScalePinchZoomEnabled()) { 548 if (Settings::pageScalePinchZoomEnabled()) {
543 Layer* rootScroll = findFirstScrollableLayer(rootLayer); 549 Layer* rootScroll = findFirstScrollableLayer(rootLayer);
544 if (rootScroll) 550 if (rootScroll)
545 rootScroll->setImplTransform(m_implTransform); 551 rootScroll->setImplTransform(m_implTransform);
546 } 552 }
547 553
548 TRACE_EVENT0("cc", "LayerTreeHost::updateLayers::calcDrawEtc"); 554 TRACE_EVENT0("cc", "LayerTreeHost::updateLayers::calcDrawEtc");
549 LayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSi ze(), m_deviceScaleFactor, m_pageScaleFactor, rendererCapabilities().maxTextureS ize, updateList); 555 LayerTreeHostCommon::calculateDrawTransforms(rootLayer, deviceViewportSi ze(), m_deviceScaleFactor, m_pageScaleFactor, rendererCapabilities().maxTextureS ize, m_settings.canUseLCDText, updateList);
550 } 556 }
551 557
552 // Reset partial texture update requests. 558 // Reset partial texture update requests.
553 m_partialTextureUpdateRequests = 0; 559 m_partialTextureUpdateRequests = 0;
554 560
555 bool needMoreUpdates = paintLayerContents(updateList, queue); 561 bool needMoreUpdates = paintLayerContents(updateList, queue);
556 if (m_triggerIdleUpdates && needMoreUpdates) { 562 if (m_triggerIdleUpdates && needMoreUpdates) {
557 TRACE_EVENT0("cc", "LayerTreeHost::updateLayers::posting prepaint task") ; 563 TRACE_EVENT0("cc", "LayerTreeHost::updateLayers::posting prepaint task") ;
558 m_prepaintCallback.Reset(base::Bind(&LayerTreeHost::triggerPrepaint, bas e::Unretained(this))); 564 m_prepaintCallback.Reset(base::Bind(&LayerTreeHost::triggerPrepaint, bas e::Unretained(this)));
559 static base::TimeDelta prepaintDelay = base::TimeDelta::FromMilliseconds (100); 565 static base::TimeDelta prepaintDelay = base::TimeDelta::FromMilliseconds (100);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 else 844 else
839 layer->notifyAnimationFinished(wallClockTime.ToDoubleT()); 845 layer->notifyAnimationFinished(wallClockTime.ToDoubleT());
840 } 846 }
841 } 847 }
842 848
843 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) 849 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex)
844 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); 850 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime);
845 } 851 }
846 852
847 } // namespace cc 853 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host.h ('k') | cc/layer_tree_host_common.h » ('j') | cc/layer_tree_host_common.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698