OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/test/fake_scrollbar_layer.h" | 5 #include "cc/test/fake_scrollbar_layer.h" |
6 | 6 |
7 #include "cc/resources/resource_update_queue.h" | 7 #include "cc/resources/resource_update_queue.h" |
8 #include "cc/test/fake_scrollbar.h" | 8 #include "cc/test/fake_scrollbar.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 FakeScrollbarLayer::FakeScrollbarLayer(bool paint_during_update, | 12 FakeScrollbarLayer::FakeScrollbarLayer(bool paint_during_update, |
13 bool has_thumb, | 13 bool has_thumb, |
14 int scrolling_layer_id) | 14 int scrolling_layer_id) |
15 : ScrollbarLayer( | 15 : ScrollbarLayer( |
16 scoped_ptr<Scrollbar>( | 16 scoped_ptr<Scrollbar>( |
17 new FakeScrollbar(paint_during_update, has_thumb, false)).Pass(), | 17 new FakeScrollbar(paint_during_update, has_thumb, false)).Pass(), |
18 scrolling_layer_id), | 18 scrolling_layer_id), |
19 update_count_(0), | 19 update_count_(0) { |
20 last_update_full_upload_size_(0), | |
21 last_update_partial_upload_size_(0) { | |
22 SetAnchorPoint(gfx::PointF(0.f, 0.f)); | 20 SetAnchorPoint(gfx::PointF(0.f, 0.f)); |
23 SetBounds(gfx::Size(1, 1)); | 21 SetBounds(gfx::Size(1, 1)); |
24 SetIsDrawable(true); | 22 SetIsDrawable(true); |
25 } | 23 } |
26 | 24 |
27 FakeScrollbarLayer::~FakeScrollbarLayer() {} | 25 FakeScrollbarLayer::~FakeScrollbarLayer() {} |
28 | 26 |
29 void FakeScrollbarLayer::Update(ResourceUpdateQueue* queue, | 27 void FakeScrollbarLayer::Update(ResourceUpdateQueue* queue, |
30 const OcclusionTracker* occlusion) { | 28 const OcclusionTracker* occlusion) { |
31 size_t full = queue->FullUploadSize(); | |
32 size_t partial = queue->PartialUploadSize(); | |
33 ScrollbarLayer::Update(queue, occlusion); | 29 ScrollbarLayer::Update(queue, occlusion); |
34 update_count_++; | 30 update_count_++; |
35 last_update_full_upload_size_ = queue->FullUploadSize() - full; | |
36 last_update_partial_upload_size_ = queue->PartialUploadSize() - partial; | |
37 } | 31 } |
38 | 32 |
39 } // namespace cc | 33 } // namespace cc |
OLD | NEW |