FileSystem mods: Changes to snapshot file creation to remove dependencies on blobs.
[chromium-blink-merge.git] / cc / image_layer.h
blob7b70fcdbfb2c52d583c852371bdc71c1ad2e125b
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"
12 namespace cc {
14 class ImageLayerUpdater;
16 // A Layer that contains only an Image element.
17 class CC_EXPORT ImageLayer : public TiledLayer {
18 public:
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);
33 private:
34 ImageLayer();
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;
44 SkBitmap m_bitmap;
46 scoped_refptr<ImageLayerUpdater> m_updater;
49 } // namespace cc
51 #endif // CC_IMAGE_LAYER_H_