1 // Copyright 2014 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_BLINK_WEB_CONTENT_LAYER_IMPL_H_
6 #define CC_BLINK_WEB_CONTENT_LAYER_IMPL_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/blink/cc_blink_export.h"
10 #include "cc/blink/web_layer_impl.h"
11 #include "cc/layers/content_layer_client.h"
12 #include "third_party/WebKit/public/platform/WebContentLayer.h"
20 class WebContentLayerClient
;
25 class WebContentLayerImpl
: public blink::WebContentLayer
,
26 public cc::ContentLayerClient
{
28 CC_BLINK_EXPORT
explicit WebContentLayerImpl(blink::WebContentLayerClient
*);
30 // WebContentLayer implementation.
31 virtual blink::WebLayer
* layer();
32 virtual void setDoubleSided(bool double_sided
);
35 virtual ~WebContentLayerImpl();
37 // ContentLayerClient implementation.
38 void PaintContents(SkCanvas
* canvas
,
39 const gfx::Rect
& clip
,
40 PaintingControlSetting painting_control
) override
;
41 scoped_refptr
<cc::DisplayItemList
> PaintContentsToDisplayList(
42 const gfx::Rect
& clip
,
43 PaintingControlSetting painting_control
) override
;
44 bool FillsBoundsCompletely() const override
;
45 size_t GetApproximateUnsharedMemoryUsage() const override
;
47 scoped_ptr
<WebLayerImpl
> layer_
;
48 blink::WebContentLayerClient
* client_
;
52 DISALLOW_COPY_AND_ASSIGN(WebContentLayerImpl
);
55 } // namespace cc_blink
57 #endif // CC_BLINK_WEB_CONTENT_LAYER_IMPL_H_