1 // Copyright 2011 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_TILED_LAYER_IMPL_H_
6 #define CC_TILED_LAYER_IMPL_H_
8 #include "cc/cc_export.h"
9 #include "cc/layer_impl.h"
13 class LayerTilingData
;
16 class CC_EXPORT TiledLayerImpl
: public LayerImpl
{
18 static scoped_ptr
<TiledLayerImpl
> create(int id
)
20 return make_scoped_ptr(new TiledLayerImpl(id
));
22 virtual ~TiledLayerImpl();
24 virtual void appendQuads(QuadSink
&, AppendQuadsData
&) OVERRIDE
;
26 virtual ResourceProvider::ResourceId
contentsResourceId() const OVERRIDE
;
28 virtual void dumpLayerProperties(std::string
*, int indent
) const OVERRIDE
;
30 void setSkipsDraw(bool skipsDraw
) { m_skipsDraw
= skipsDraw
; }
31 void setTilingData(const LayerTilingData
& tiler
);
32 void pushTileProperties(int, int, ResourceProvider::ResourceId
, const gfx::Rect
& opaqueRect
, bool contentsSwizzled
);
33 void pushInvalidTile(int, int);
35 virtual Region
visibleContentOpaqueRegion() const OVERRIDE
;
36 virtual void didLoseOutputSurface() OVERRIDE
;
39 explicit TiledLayerImpl(int id
);
40 // Exposed for testing.
41 bool hasTileAt(int, int) const;
42 bool hasResourceIdForTileAt(int, int) const;
44 virtual void getDebugBorderProperties(SkColor
*, float* width
) const OVERRIDE
;
48 virtual const char* layerTypeAsString() const OVERRIDE
;
50 DrawableTile
* tileAt(int, int) const;
51 DrawableTile
* createTile(int, int);
55 scoped_ptr
<LayerTilingData
> m_tiler
;
60 #endif // CC_TILED_LAYER_IMPL_H_