cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / cc / test / fake_content_layer.cc
blob077831fd2d8a781c8ffeca3d17415574ba9c28d2
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_content_layer.h"
7 #include "cc/resources/prioritized_resource.h"
8 #include "cc/test/fake_content_layer_impl.h"
10 namespace cc {
12 FakeContentLayer::FakeContentLayer(ContentLayerClient* client)
13 : ContentLayer(client),
14 update_count_(0),
15 push_properties_count_(0),
16 always_update_resources_(false) {
17 SetAnchorPoint(gfx::PointF(0.f, 0.f));
18 SetBounds(gfx::Size(1, 1));
19 SetIsDrawable(true);
22 FakeContentLayer::~FakeContentLayer() {}
24 scoped_ptr<LayerImpl> FakeContentLayer::CreateLayerImpl(
25 LayerTreeImpl* tree_impl) {
26 return FakeContentLayerImpl::Create(tree_impl, layer_id_).PassAs<LayerImpl>();
29 bool FakeContentLayer::Update(ResourceUpdateQueue* queue,
30 const OcclusionTracker* occlusion) {
31 bool updated = ContentLayer::Update(queue, occlusion);
32 update_count_++;
33 return updated || always_update_resources_;
36 void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) {
37 ContentLayer::PushPropertiesTo(layer);
38 push_properties_count_++;
41 bool FakeContentLayer::HaveBackingAt(int i, int j) {
42 const PrioritizedResource* resource = ResourceAtForTesting(i, j);
43 return resource && resource->have_backing_texture();
46 } // namespace cc