Revert "Merged all Chromoting Host code into remoting_core.dll (Windows)."
[chromium-blink-merge.git] / cc / test / fake_scrollbar_layer.cc
blob96c9daff311b098ff76686a2f8dced570886c04a
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
3 // found in the LICENSE file.
5 #include "cc/test/fake_scrollbar_layer.h"
7 #include "cc/resource_update_queue.h"
8 #include "cc/test/fake_scrollbar_theme_painter.h"
9 #include "cc/test/fake_web_scrollbar.h"
10 #include "cc/test/fake_web_scrollbar_theme_geometry.h"
12 namespace cc {
14 FakeScrollbarLayer::FakeScrollbarLayer(
15 bool paint_during_update, bool has_thumb, int scrolling_layer_id)
16 : ScrollbarLayer(
17 FakeWebScrollbar::create().PassAs<WebKit::WebScrollbar>(),
18 FakeScrollbarThemePainter::Create(paint_during_update)
19 .PassAs<ScrollbarThemePainter>(),
20 FakeWebScrollbarThemeGeometry::create(has_thumb)
21 .PassAs<WebKit::WebScrollbarThemeGeometry>(),
22 scrolling_layer_id),
23 update_count_(0),
24 last_update_full_upload_size_(0),
25 last_update_partial_upload_size_(0) {
26 setAnchorPoint(gfx::PointF(0, 0));
27 setBounds(gfx::Size(1, 1));
28 setIsDrawable(true);
31 FakeScrollbarLayer::~FakeScrollbarLayer() {}
33 void FakeScrollbarLayer::update(
34 ResourceUpdateQueue& queue,
35 const OcclusionTracker* occlusion,
36 RenderingStats& stats) {
37 size_t full = queue.fullUploadSize();
38 size_t partial = queue.partialUploadSize();
39 ScrollbarLayer::update(queue, occlusion, stats);
40 update_count_++;
41 last_update_full_upload_size_ = queue.fullUploadSize() - full;
42 last_update_partial_upload_size_ = queue.partialUploadSize() - partial;
45 } // namespace cc