1 // Copyright 2010 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 #ifndef CC_IMAGE_LAYER_H_
6 #define CC_IMAGE_LAYER_H_
8 #include "cc/cc_export.h"
9 #include "cc/content_layer.h"
10 #include "third_party/skia/include/core/SkBitmap.h"
14 class ImageLayerUpdater
;
16 // A Layer that contains only an Image element.
17 class CC_EXPORT ImageLayer
: public TiledLayer
{
19 static scoped_refptr
<ImageLayer
> create();
21 virtual bool drawsContent() const OVERRIDE
;
22 virtual void setTexturePriorities(const PriorityCalculator
&) OVERRIDE
;
23 virtual void update(ResourceUpdateQueue
&, const OcclusionTracker
*, RenderingStats
*) OVERRIDE
;
24 virtual void calculateContentsScale(
25 float idealContentsScale
,
26 bool animating_transform_to_screen
,
27 float* contentsScaleX
,
28 float* contentsScaleY
,
29 gfx::Size
* contentBounds
) OVERRIDE
;
31 void setBitmap(const SkBitmap
& image
);
35 virtual ~ImageLayer();
37 void setTilingOption(TilingOption
);
39 virtual LayerUpdater
* updater() const OVERRIDE
;
40 virtual void createUpdaterIfNeeded() OVERRIDE
;
41 float imageContentsScaleX() const;
42 float imageContentsScaleY() const;
46 scoped_refptr
<ImageLayerUpdater
> m_updater
;
51 #endif // CC_IMAGE_LAYER_H_