Include all dupe types (event when value is zero) in scan stats.
[chromium-blink-merge.git] / cc / test / fake_painted_scrollbar_layer.cc
blob4d0f6cc7a0cedd63e028431a9c45bff222651008
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/test/fake_painted_scrollbar_layer.h"
7 #include "base/auto_reset.h"
8 #include "cc/resources/resource_update_queue.h"
9 #include "cc/test/fake_scrollbar.h"
11 namespace cc {
13 scoped_refptr<FakePaintedScrollbarLayer> FakePaintedScrollbarLayer::Create(
14 const LayerSettings& settings,
15 bool paint_during_update,
16 bool has_thumb,
17 int scrolling_layer_id) {
18 FakeScrollbar* fake_scrollbar = new FakeScrollbar(
19 paint_during_update, has_thumb, false);
20 return make_scoped_refptr(new FakePaintedScrollbarLayer(
21 settings, fake_scrollbar, scrolling_layer_id));
24 FakePaintedScrollbarLayer::FakePaintedScrollbarLayer(
25 const LayerSettings& settings,
26 FakeScrollbar* fake_scrollbar,
27 int scrolling_layer_id)
28 : PaintedScrollbarLayer(settings,
29 scoped_ptr<Scrollbar>(fake_scrollbar).Pass(),
30 scrolling_layer_id),
31 update_count_(0),
32 push_properties_count_(0),
33 fake_scrollbar_(fake_scrollbar) {
34 SetBounds(gfx::Size(1, 1));
35 SetIsDrawable(true);
38 FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {}
40 bool FakePaintedScrollbarLayer::Update(
41 ResourceUpdateQueue* queue,
42 const OcclusionTracker<Layer>* occlusion) {
43 bool updated = PaintedScrollbarLayer::Update(queue, occlusion);
44 ++update_count_;
45 return updated;
48 void FakePaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
49 PaintedScrollbarLayer::PushPropertiesTo(layer);
50 ++push_properties_count_;
53 scoped_ptr<base::AutoReset<bool>>
54 FakePaintedScrollbarLayer::IgnoreSetNeedsCommit() {
55 return make_scoped_ptr(
56 new base::AutoReset<bool>(&ignore_set_needs_commit_, true));
59 } // namespace cc