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

Unified Diff: cc/scrollbar_layer_impl.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/scrollbar_layer.cc ('k') | cc/scrollbar_layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scrollbar_layer_impl.cc
diff --git a/cc/scrollbar_layer_impl.cc b/cc/scrollbar_layer_impl.cc
index f0b5f7f0d2cd916a24da8e61df15e447b4652247..976f4cb9dbe809e34488e53fe140d20b13d8f5d6 100644
--- a/cc/scrollbar_layer_impl.cc
+++ b/cc/scrollbar_layer_impl.cc
@@ -5,8 +5,10 @@
#include "cc/scrollbar_layer_impl.h"
#include "cc/layer_tree_impl.h"
+#include "cc/layer_tree_settings.h"
#include "cc/quad_sink.h"
#include "cc/scrollbar_animation_controller.h"
+#include "cc/solid_color_draw_quad.h"
#include "cc/texture_draw_quad.h"
#include "ui/gfx/rect_conversions.h"
@@ -151,6 +153,21 @@ void ScrollbarLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& append
if (!m_geometry->hasThumb(&m_scrollbar))
thumbRect = WebRect();
+ if (layerTreeImpl()->settings().solidColorScrollbars) {
+ int thicknessOverride = layerTreeImpl()->settings().solidColorScrollbarThicknessDIP;
+ if (thicknessOverride != -1) {
+ if (m_scrollbar.orientation() == WebScrollbar::Vertical)
+ thumbRect.width = thicknessOverride;
+ else
+ thumbRect.height = thicknessOverride;
+ }
+ gfx::Rect quadRect(scrollbarLayerRectToContentRect(thumbRect));
+ scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
+ quad->SetNew(sharedQuadState, quadRect, layerTreeImpl()->settings().solidColorScrollbarColor);
+ quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
+ return;
+ }
+
if (m_thumbResourceId && !thumbRect.isEmpty()) {
gfx::Rect quadRect(scrollbarLayerRectToContentRect(thumbRect));
gfx::Rect opaqueRect;
« no previous file with comments | « cc/scrollbar_layer.cc ('k') | cc/scrollbar_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698