blob: c475e53408bb6e58dabbb2532b7480109cd2cd93 [file] [log] [blame]
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001// Copyright 2013 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_LAYERS_PICTURE_IMAGE_LAYER_IMPL_H_
6#define CC_LAYERS_PICTURE_IMAGE_LAYER_IMPL_H_
7
8#include "cc/layers/picture_layer_impl.h"
9
10namespace cc {
11
12class CC_EXPORT PictureImageLayerImpl : public PictureLayerImpl {
13 public:
14 static scoped_ptr<PictureImageLayerImpl> Create(LayerTreeImpl* tree_impl,
15 int id) {
16 return make_scoped_ptr(new PictureImageLayerImpl(tree_impl, id));
17 }
18 virtual ~PictureImageLayerImpl();
19
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010020 // LayerImpl overrides.
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000021 virtual const char* LayerTypeAsString() const OVERRIDE;
22 virtual scoped_ptr<LayerImpl> CreateLayerImpl(
23 LayerTreeImpl* tree_impl) OVERRIDE;
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010024 virtual void CalculateContentsScale(float ideal_contents_scale,
25 float device_scale_factor,
26 float page_scale_factor,
27 bool animating_transform_to_screen,
28 float* contents_scale_x,
29 float* contents_scale_y,
30 gfx::Size* content_bounds) OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000031
32 protected:
33 PictureImageLayerImpl(LayerTreeImpl* tree_impl, int id);
34
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010035 virtual bool ShouldAdjustRasterScale(
36 bool animating_transform_to_screen) const OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000037 virtual void CalculateRasterContentsScale(
38 bool animating_transform_to_screen,
39 float* raster_contents_scale,
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010040 float* low_res_raster_contents_scale) const OVERRIDE;
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000041 virtual void GetDebugBorderProperties(
42 SkColor* color, float* width) const OVERRIDE;
43
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010044 private:
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000045 DISALLOW_COPY_AND_ASSIGN(PictureImageLayerImpl);
46};
47
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010048} // namespace cc
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000049
50#endif // CC_LAYERS_PICTURE_IMAGE_LAYER_IMPL_H_