| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ | 5 #ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ |
| 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ | 6 #define WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "cc/layer_tree_host_client.h" | 9 #include "cc/layer_tree_host_client.h" |
| 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" | 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeView.h" |
| 11 #include "webkit/compositor_bindings/webkit_compositor_bindings_export.h" | 11 #include "webkit/compositor_bindings/webkit_compositor_bindings_export.h" |
| 12 #include "webkit/support/webkit_support.h" | 12 #include "webkit/support/webkit_support.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 class LayerTreeHost; | 15 class LayerTreeHost; |
| 16 class Thread; | 16 class Thread; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace WebKit { | 19 namespace WebKit { |
| 20 class WebLayer; | 20 class WebLayer; |
| 21 | 21 |
| 22 class WebLayerTreeViewImplForTesting : public WebKit::WebLayerTreeView, | 22 class WebLayerTreeViewImplForTesting : public WebKit::WebLayerTreeView, |
| 23 public cc::LayerTreeHostClient { | 23 public cc::LayerTreeHostClient { |
| 24 public: | 24 public: |
| 25 enum RenderingType { | |
| 26 FAKE_CONTEXT, | |
| 27 SOFTWARE_CONTEXT, | |
| 28 MESA_CONTEXT | |
| 29 }; | |
| 30 WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerTreeViewImplForTesting( | 25 WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebLayerTreeViewImplForTesting( |
| 31 RenderingType type, | 26 webkit_support::LayerTreeViewType type, |
| 32 webkit_support::DRTLayerTreeViewClient* client); | 27 webkit_support::DRTLayerTreeViewClient* client); |
| 33 virtual ~WebLayerTreeViewImplForTesting(); | 28 virtual ~WebLayerTreeViewImplForTesting(); |
| 34 | 29 |
| 35 WEBKIT_COMPOSITOR_BINDINGS_EXPORT bool initialize( | 30 WEBKIT_COMPOSITOR_BINDINGS_EXPORT bool initialize( |
| 36 scoped_ptr<cc::Thread> compositor_thread); | 31 scoped_ptr<cc::Thread> compositor_thread); |
| 37 | 32 |
| 38 // WebLayerTreeView implementation. | 33 // WebLayerTreeView implementation. |
| 39 virtual void setSurfaceReady(); | 34 virtual void setSurfaceReady(); |
| 40 virtual void setRootLayer(const WebLayer&); | 35 virtual void setRootLayer(const WebLayer&); |
| 41 virtual void clearRootLayer(); | 36 virtual void clearRootLayer(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 virtual void didCommit() OVERRIDE; | 75 virtual void didCommit() OVERRIDE; |
| 81 virtual void didCommitAndDrawFrame() OVERRIDE; | 76 virtual void didCommitAndDrawFrame() OVERRIDE; |
| 82 virtual void didCompleteSwapBuffers() OVERRIDE; | 77 virtual void didCompleteSwapBuffers() OVERRIDE; |
| 83 virtual void scheduleComposite() OVERRIDE; | 78 virtual void scheduleComposite() OVERRIDE; |
| 84 virtual scoped_refptr<cc::ContextProvider> | 79 virtual scoped_refptr<cc::ContextProvider> |
| 85 OffscreenContextProviderForMainThread() OVERRIDE; | 80 OffscreenContextProviderForMainThread() OVERRIDE; |
| 86 virtual scoped_refptr<cc::ContextProvider> | 81 virtual scoped_refptr<cc::ContextProvider> |
| 87 OffscreenContextProviderForCompositorThread() OVERRIDE; | 82 OffscreenContextProviderForCompositorThread() OVERRIDE; |
| 88 | 83 |
| 89 private: | 84 private: |
| 90 RenderingType type_; | 85 webkit_support::LayerTreeViewType type_; |
| 91 webkit_support::DRTLayerTreeViewClient* client_; | 86 webkit_support::DRTLayerTreeViewClient* client_; |
| 92 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; | 87 scoped_ptr<cc::LayerTreeHost> layer_tree_host_; |
| 93 }; | 88 }; |
| 94 | 89 |
| 95 } // namespace Web_kit | 90 } // namespace Web_kit |
| 96 | 91 |
| 97 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ | 92 #endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_LAYER_TREE_VIEW_IMPL_FOR_TESTING_H_ |
| OLD | NEW |