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

Unified Diff: cc/hardcoded_scrollbar.h

Issue 12147005: Hardcode scrollbar rendering for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hardcoded scrollbar not using layer structure. similar to M18 approach 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
Index: cc/hardcoded_scrollbar.h
diff --git a/cc/hardcoded_scrollbar.h b/cc/hardcoded_scrollbar.h
new file mode 100644
index 0000000000000000000000000000000000000000..31fee855965d11a664b6c6741434ee01d124c7a2
--- /dev/null
+++ b/cc/hardcoded_scrollbar.h
@@ -0,0 +1,57 @@
+// Copyright 2011 The Chromium Authors. All rights reserved.
danakj 2013/02/05 17:55:02 2013
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_HARDCODED_SCROLLBAR_H_
+#define CC_HARDCODED_SCROLLBAR_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
+#include "build/build_config.h"
+#include "ui/gfx/vector2d.h"
+
+namespace cc {
+
+class LayerTreeHostImpl;
+class RenderPass;
+class SharedQuadState;
+
+#if defined(OS_ANDROID)
+// FIXME(trchen): This class a quick hack scrollbar for Android for M25.
+// Need to disable WebKit-side scrollbar for now because sublayer
+// scrollbars aren't coordinated in the compositor, and the update latency is
+// too long when impl-side painting is enabled. We should remove this hack
+// after implementing the coordinator for sublayer scrollbars.
+class HardcodedScrollbar {
+public:
+ HardcodedScrollbar(LayerTreeHostImpl* layer_tree_host_impl);
danakj 2013/02/05 17:55:02 1 space before this
+ void Animate(base::TimeTicks monotonic_time);
+ void PrependQuads(RenderPass* render_pass);
+ void DidPinchGestureUpdate(base::TimeTicks monotonic_time);
+ void DidPinchGestureEnd(base::TimeTicks monotonic_time);
+ void DidUpdateScrollOffset(base::TimeTicks monotonic_time);
+private:
+ LayerTreeHostImpl* layer_tree_host_impl_;
danakj 2013/02/05 17:55:02 1 space
+
+ float opacity_;
+ bool pinch_in_effect_;
+ gfx::Vector2dF last_scroll_offset_;
+ base::TimeTicks last_awaken_time_;
+};
+#else
+// This is a dummy class for platforms that don't need a hardcoded scrollbar.
+// Everything is inlined for zero overhead.
+class HardcodedScrollbar {
+public:
danakj 2013/02/05 17:55:02 1 space
+ inline HardcodedScrollbar(LayerTreeHostImpl*) { }
danakj 2013/02/05 17:55:02 no space between {}s
+ inline void Animate(base::TimeTicks) { }
danakj 2013/02/05 17:55:02 variables should still get names i believe
+ inline void PrependQuads(RenderPass*) { }
+ inline void DidPinchGestureUpdate(base::TimeTicks) { }
+ inline void DidPinchGestureEnd(base::TimeTicks) { }
+ inline void DidUpdateScrollOffset(base::TimeTicks) { }
+};
+#endif
+
+} // namespace cc
+
+#endif // CC_HARDCODED_SCROLLBAR_H_
« no previous file with comments | « cc/cc.gyp ('k') | cc/hardcoded_scrollbar.cc » ('j') | cc/hardcoded_scrollbar.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698