summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_painted_scrollbar_layer.cc
diff options
context:
space:
mode:
authorwjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-22 20:55:17 +0000
committerwjmaclean@chromium.org <wjmaclean@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-22 20:55:17 +0000
commit3a83478b512978046269739d5c2e2ef47e747ebe (patch)
tree37675287c83e5ec4ef8d83a5dd5d1aaa64cd72a3 /cc/test/fake_painted_scrollbar_layer.cc
parent25b37931d3fcd438afb09eaa6285aa584f46acd5 (diff)
downloadchromium_src-3a83478b512978046269739d5c2e2ef47e747ebe.zip
chromium_src-3a83478b512978046269739d5c2e2ef47e747ebe.tar.gz
chromium_src-3a83478b512978046269739d5c2e2ef47e747ebe.tar.bz2
Rename ScrollbarLayer\* to PaintedScrollbarLayer\*
In preparation for splitting the ScrollbarLayer class, rename it to PaintedScrollbarLayer. A new layer type, SolidColorScrollbarLayer will be created, and both classes will derive from ScrollbarLayerInterface. Similarly, ScrollbarLayerImpl is renamed PaintedScrollbarLayerImpl, a new class SolidColorScrollbarLayerImpl is created, both deriving from a shared base class ScrollbarLayerImplBase. FakeScrollbarLayer is renamed to FakePaintedScrollbarLayer. BUG= Review URL: https://chromiumcodereview.appspot.com/23068016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_painted_scrollbar_layer.cc')
-rw-r--r--cc/test/fake_painted_scrollbar_layer.cc56
1 files changed, 56 insertions, 0 deletions
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc
new file mode 100644
index 0000000..72ef420
--- /dev/null
+++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -0,0 +1,56 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/fake_painted_scrollbar_layer.h"
+
+#include "base/auto_reset.h"
+#include "cc/resources/resource_update_queue.h"
+#include "cc/test/fake_scrollbar.h"
+
+namespace cc {
+
+scoped_refptr<FakePaintedScrollbarLayer> FakePaintedScrollbarLayer::Create(
+ bool paint_during_update,
+ bool has_thumb,
+ int scrolling_layer_id) {
+ FakeScrollbar* fake_scrollbar = new FakeScrollbar(
+ paint_during_update, has_thumb, false);
+ return make_scoped_refptr(new FakePaintedScrollbarLayer(
+ fake_scrollbar, scrolling_layer_id));
+}
+
+FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
+ FakeScrollbar* fake_scrollbar,
+ int scrolling_layer_id)
+ : PaintedScrollbarLayer(scoped_ptr<Scrollbar>(fake_scrollbar).Pass(),
+ scrolling_layer_id),
+ update_count_(0),
+ push_properties_count_(0),
+ fake_scrollbar_(fake_scrollbar) {
+ SetAnchorPoint(gfx::PointF(0.f, 0.f));
+ SetBounds(gfx::Size(1, 1));
+ SetIsDrawable(true);
+}
+
+FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {}
+
+bool FakePaintedScrollbarLayer::Update(ResourceUpdateQueue* queue,
+ const OcclusionTracker* occlusion) {
+ bool updated = PaintedScrollbarLayer::Update(queue, occlusion);
+ ++update_count_;
+ return updated;
+}
+
+void FakePaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
+ PaintedScrollbarLayer::PushPropertiesTo(layer);
+ ++push_properties_count_;
+}
+
+scoped_ptr<base::AutoReset<bool> >
+FakePaintedScrollbarLayer::IgnoreSetNeedsCommit() {
+ return make_scoped_ptr(
+ new base::AutoReset<bool>(&ignore_set_needs_commit_, true));
+}
+
+} // namespace cc