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

Side by Side Diff: cc/test/fake_scrollbar_layer.cc

Issue 17550008: Make IsSolidColor() a property on CC scrollbar layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Jochen's comments. Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 bool is_solid_color)
15 : ScrollbarLayer( 16 : ScrollbarLayer(
16 scoped_ptr<Scrollbar>( 17 scoped_ptr<Scrollbar>(
17 new FakeScrollbar(paint_during_update, has_thumb, false)).Pass(), 18 new FakeScrollbar(paint_during_update, has_thumb, false)).Pass(),
18 scrolling_layer_id), 19 scrolling_layer_id,
20 is_solid_color),
19 update_count_(0), 21 update_count_(0),
20 last_update_full_upload_size_(0), 22 last_update_full_upload_size_(0),
21 last_update_partial_upload_size_(0) { 23 last_update_partial_upload_size_(0) {
22 SetAnchorPoint(gfx::PointF(0.f, 0.f)); 24 SetAnchorPoint(gfx::PointF(0.f, 0.f));
23 SetBounds(gfx::Size(1, 1)); 25 SetBounds(gfx::Size(1, 1));
24 SetIsDrawable(true); 26 SetIsDrawable(true);
25 } 27 }
26 28
27 FakeScrollbarLayer::~FakeScrollbarLayer() {} 29 FakeScrollbarLayer::~FakeScrollbarLayer() {}
28 30
29 void FakeScrollbarLayer::Update(ResourceUpdateQueue* queue, 31 void FakeScrollbarLayer::Update(ResourceUpdateQueue* queue,
30 const OcclusionTracker* occlusion) { 32 const OcclusionTracker* occlusion) {
31 size_t full = queue->FullUploadSize(); 33 size_t full = queue->FullUploadSize();
32 size_t partial = queue->PartialUploadSize(); 34 size_t partial = queue->PartialUploadSize();
33 ScrollbarLayer::Update(queue, occlusion); 35 ScrollbarLayer::Update(queue, occlusion);
34 update_count_++; 36 update_count_++;
35 last_update_full_upload_size_ = queue->FullUploadSize() - full; 37 last_update_full_upload_size_ = queue->FullUploadSize() - full;
36 last_update_partial_upload_size_ = queue->PartialUploadSize() - partial; 38 last_update_partial_upload_size_ = queue->PartialUploadSize() - partial;
37 } 39 }
38 40
39 } // namespace cc 41 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698