Home | History | Annotate | Download | only in test
      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.
      4 
      5 #ifndef CC_TEST_FAKE_PICTURE_LAYER_H_
      6 #define CC_TEST_FAKE_PICTURE_LAYER_H_
      7 
      8 #include "base/memory/ref_counted.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "cc/layers/picture_layer.h"
     11 
     12 namespace cc {
     13 
     14 class FakePictureLayer : public PictureLayer {
     15  public:
     16   static scoped_refptr<FakePictureLayer> Create(ContentLayerClient* client) {
     17     return make_scoped_refptr(new FakePictureLayer(client));
     18   }
     19 
     20   virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
     21       OVERRIDE;
     22 
     23   size_t update_count() const { return update_count_; }
     24   void reset_update_count() { update_count_ = 0; }
     25 
     26   size_t push_properties_count() const { return push_properties_count_; }
     27   void reset_push_properties_count() { push_properties_count_ = 0; }
     28 
     29   void set_always_update_resources(bool always_update_resources) {
     30     always_update_resources_ = always_update_resources;
     31   }
     32 
     33   virtual bool Update(ResourceUpdateQueue* queue,
     34                       const OcclusionTracker* occlusion) OVERRIDE;
     35 
     36   virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
     37 
     38  private:
     39   explicit FakePictureLayer(ContentLayerClient* client);
     40   virtual ~FakePictureLayer();
     41 
     42   size_t update_count_;
     43   size_t push_properties_count_;
     44   bool always_update_resources_;
     45 };
     46 
     47 }  // namespace cc
     48 
     49 #endif  // CC_TEST_FAKE_PICTURE_LAYER_H_
     50