• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef CC_BLINK_WEB_CONTENT_LAYER_IMPL_H_
6 #define CC_BLINK_WEB_CONTENT_LAYER_IMPL_H_
7 
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"
13 
14 namespace cc {
15 class IntRect;
16 class FloatRect;
17 }
18 
19 namespace blink {
20 class WebContentLayerClient;
21 }
22 
23 namespace cc_blink {
24 
25 class WebContentLayerImpl : public blink::WebContentLayer,
26                             public cc::ContentLayerClient {
27  public:
28   CC_BLINK_EXPORT explicit WebContentLayerImpl(blink::WebContentLayerClient*);
29 
30   // WebContentLayer implementation.
31   virtual blink::WebLayer* layer();
32   virtual void setDoubleSided(bool double_sided);
33   virtual void setDrawCheckerboardForMissingTiles(bool checkerboard);
34 
35  protected:
36   virtual ~WebContentLayerImpl();
37 
38   // ContentLayerClient implementation.
39   virtual void PaintContents(SkCanvas* canvas,
40                              const gfx::Rect& clip,
41                              ContentLayerClient::GraphicsContextStatus
42                                  graphics_context_status) OVERRIDE;
43   virtual void DidChangeLayerCanUseLCDText() OVERRIDE;
44   virtual bool FillsBoundsCompletely() const OVERRIDE;
45 
46   scoped_ptr<WebLayerImpl> layer_;
47   blink::WebContentLayerClient* client_;
48   bool draws_content_;
49 
50  private:
51   bool can_use_lcd_text_;
52   bool ignore_lcd_text_change_;
53 
54   DISALLOW_COPY_AND_ASSIGN(WebContentLayerImpl);
55 };
56 
57 }  // namespace cc_blink
58 
59 #endif  // CC_BLINK_WEB_CONTENT_LAYER_IMPL_H_
60