Add test for clicking bookmark star in presence of ctrl-D keybinding
[chromium-blink-merge.git] / cc / layers / tiled_layer_impl.h
blobe3ace3497a526e9e117aa91e49be99fc25ceb7cf
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_LAYERS_TILED_LAYER_IMPL_H_
6 #define CC_LAYERS_TILED_LAYER_IMPL_H_
8 #include <string>
10 #include "cc/base/cc_export.h"
11 #include "cc/layers/layer_impl.h"
13 namespace cc {
15 class LayerTilingData;
16 class DrawableTile;
18 class CC_EXPORT TiledLayerImpl : public LayerImpl {
19 public:
20 static scoped_ptr<TiledLayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
21 return make_scoped_ptr(new TiledLayerImpl(tree_impl, id));
23 ~TiledLayerImpl() override;
25 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
26 void PushPropertiesTo(LayerImpl* layer) override;
28 bool WillDraw(DrawMode draw_mode,
29 ResourceProvider* resource_provider) override;
30 void AppendQuads(RenderPass* render_pass,
31 const Occlusion& occlusion_in_content_space,
32 AppendQuadsData* append_quads_data) override;
34 void GetContentsResourceId(ResourceProvider::ResourceId* resource_id,
35 gfx::Size* resource_size) const override;
37 void set_skips_draw(bool skips_draw) { skips_draw_ = skips_draw; }
38 void SetTilingData(const LayerTilingData& tiler);
39 void PushTileProperties(int i,
40 int j,
41 ResourceProvider::ResourceId resource,
42 bool contents_swizzled);
43 void PushInvalidTile(int i, int j);
45 SimpleEnclosedRegion VisibleContentOpaqueRegion() const override;
46 void ReleaseResources() override;
48 const LayerTilingData* TilingForTesting() const { return tiler_.get(); }
50 size_t GPUMemoryUsageInBytes() const override;
52 protected:
53 TiledLayerImpl(LayerTreeImpl* tree_impl, int id);
54 // Exposed for testing.
55 bool HasTileAt(int i, int j) const;
56 bool HasResourceIdForTileAt(int i, int j) const;
58 void GetDebugBorderProperties(SkColor* color, float* width) const override;
59 void AsValueInto(base::debug::TracedValue* dict) const override;
61 private:
62 const char* LayerTypeAsString() const override;
64 DrawableTile* TileAt(int i, int j) const;
65 DrawableTile* CreateTile(int i, int j);
67 bool skips_draw_;
69 scoped_ptr<LayerTilingData> tiler_;
71 DISALLOW_COPY_AND_ASSIGN(TiledLayerImpl);
74 } // namespace cc
76 #endif // CC_LAYERS_TILED_LAYER_IMPL_H_