| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 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. | |
| 4 | |
| 5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_CC_H_ | |
| 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_CC_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "ui/gfx/compositor/compositor.h" | |
| 11 #include "ui/gfx/size.h" | |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayer.h" | |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerClient.h" | |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerTreeView.h" | |
| 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebLayerTreeViewClien
t.h" | |
| 16 | |
| 17 namespace gfx { | |
| 18 class Rect; | |
| 19 } | |
| 20 | |
| 21 namespace ui { | |
| 22 | |
| 23 class COMPOSITOR_EXPORT TextureCC : public Texture { | |
| 24 public: | |
| 25 TextureCC(); | |
| 26 | |
| 27 // Texture implementation. | |
| 28 virtual void SetCanvas(const SkCanvas& canvas, | |
| 29 const gfx::Point& origin, | |
| 30 const gfx::Size& overall_size) OVERRIDE; | |
| 31 | |
| 32 virtual void Draw(const ui::TextureDrawParams& params, | |
| 33 const gfx::Rect& clip_bounds_in_texture) OVERRIDE; | |
| 34 | |
| 35 private: | |
| 36 DISALLOW_COPY_AND_ASSIGN(TextureCC); | |
| 37 }; | |
| 38 | |
| 39 class COMPOSITOR_EXPORT CompositorCC : public Compositor, | |
| 40 public WebKit::WebLayerTreeViewClient, | |
| 41 public WebKit::WebLayerClient { | |
| 42 public: | |
| 43 CompositorCC(CompositorDelegate* delegate, | |
| 44 gfx::AcceleratedWidget widget, | |
| 45 const gfx::Size& size); | |
| 46 virtual ~CompositorCC(); | |
| 47 | |
| 48 static void InitializeThread(); | |
| 49 static void TerminateThread(); | |
| 50 | |
| 51 protected: | |
| 52 // Compositor implementation. | |
| 53 virtual Texture* CreateTexture() OVERRIDE; | |
| 54 virtual void Blur(const gfx::Rect& bounds) OVERRIDE; | |
| 55 virtual void ScheduleDraw() OVERRIDE; | |
| 56 virtual void OnNotifyStart(bool clear) OVERRIDE; | |
| 57 virtual void OnNotifyEnd() OVERRIDE; | |
| 58 virtual void OnWidgetSizeChanged() OVERRIDE; | |
| 59 virtual void OnRootLayerChanged() OVERRIDE; | |
| 60 virtual void DrawTree() OVERRIDE; | |
| 61 | |
| 62 // WebLayerTreeViewClient implementation. | |
| 63 virtual void animateAndLayout(double frameBeginTime) OVERRIDE; | |
| 64 virtual void applyScrollDelta(const WebKit::WebSize&) OVERRIDE; | |
| 65 virtual WebKit::WebGraphicsContext3D* createContext3D() OVERRIDE; | |
| 66 virtual void didRebindGraphicsContext(bool success) OVERRIDE; | |
| 67 virtual void scheduleComposite() OVERRIDE; | |
| 68 | |
| 69 // WebLayerClient implementation. | |
| 70 virtual void notifyNeedsComposite() OVERRIDE; | |
| 71 | |
| 72 private: | |
| 73 gfx::AcceleratedWidget widget_; | |
| 74 WebKit::WebLayer root_web_layer_; | |
| 75 WebKit::WebLayerTreeView host_; | |
| 76 | |
| 77 DISALLOW_COPY_AND_ASSIGN(CompositorCC); | |
| 78 }; | |
| 79 | |
| 80 } // namespace ui | |
| 81 | |
| 82 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_CC_H_ | |
| OLD | NEW |