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

Unified Diff: cc/scrollbar_layer.cc

Issue 12297009: cc: SolidColorQuad-based scrollbars for Android [M25] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DCHECK failure in test by creating render surface Created 7 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_settings.cc ('k') | cc/scrollbar_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer.cc
diff --git a/cc/scrollbar_layer.cc b/cc/scrollbar_layer.cc
index 6fad23cb11481dd7b64811a269b10d5fe873779f..ded7bf12a9a4f3f7c99066ef7cc33565ab0dc89c 100644
--- a/cc/scrollbar_layer.cc
+++ b/cc/scrollbar_layer.cc
@@ -70,6 +70,9 @@ int ScrollbarLayer::maxTextureSize() {
}
float ScrollbarLayer::clampScaleToMaxTextureSize(float scale) {
+ if (layerTreeHost()->settings().solidColorScrollbars)
+ return scale;
+
// If the scaled contentBounds() is bigger than the max texture size of the
// device, we need to clamp it by rescaling, since contentBounds() is used
// below to set the texture size.
@@ -229,6 +232,9 @@ void ScrollbarLayer::setLayerTreeHost(LayerTreeHost* host)
void ScrollbarLayer::createUpdaterIfNeeded()
{
+ if (layerTreeHost()->settings().solidColorScrollbars)
+ return;
+
m_textureFormat = layerTreeHost()->rendererCapabilities().bestTextureFormat;
if (!m_backTrackUpdater)
@@ -252,6 +258,9 @@ void ScrollbarLayer::createUpdaterIfNeeded()
void ScrollbarLayer::updatePart(CachingBitmapContentLayerUpdater* painter, LayerUpdater::Resource* resource, const gfx::Rect& rect, ResourceUpdateQueue& queue, RenderingStats* stats)
{
+ if (layerTreeHost()->settings().solidColorScrollbars)
+ return;
+
// Skip painting and uploading if there are no invalidations and
// we already have valid texture data.
if (resource->texture()->haveBackingTexture() &&
@@ -290,6 +299,9 @@ gfx::Rect ScrollbarLayer::scrollbarLayerRectToContentRect(const gfx::Rect& layer
void ScrollbarLayer::setTexturePriorities(const PriorityCalculator&)
{
+ if (layerTreeHost()->settings().solidColorScrollbars)
+ return;
+
if (contentBounds().IsEmpty())
return;
DCHECK_LE(contentBounds().width(), maxTextureSize());
« no previous file with comments | « cc/layer_tree_settings.cc ('k') | cc/scrollbar_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698