| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 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 #include "webkit/compositor/web_compositor_support_impl.h" |
| 6 |
| 7 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 8 #include "webkit/compositor/WebLayerImpl.h" |
| 9 #include "webkit/compositor/WebLayerTreeViewImpl.h" |
| 10 #include "webkit/compositor/WebContentLayerImpl.h" |
| 11 #include "webkit/compositor/WebExternalTextureLayerImpl.h" |
| 12 #include "webkit/compositor/WebIOSurfaceLayerImpl.h" |
| 13 #include "webkit/compositor/WebSolidColorLayerImpl.h" |
| 14 #include "webkit/compositor/WebImageLayerImpl.h" |
| 15 #include "webkit/compositor/WebVideoLayerImpl.h" |
| 16 #include "webkit/compositor/WebScrollbarLayerImpl.h" |
| 17 #include "webkit/compositor/WebAnimationImpl.h" |
| 18 #include "webkit/compositor/WebFloatAnimationCurveImpl.h" |
| 19 #include "webkit/compositor/WebTransformAnimationCurveImpl.h" |
| 20 #else |
| 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebAnimation.h" |
| 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayer.h" |
| 23 #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureL
ayer.h" |
| 24 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatAnimationCu
rve.h" |
| 25 #include "third_party/WebKit/Source/Platform/chromium/public/WebIOSurfaceLayer.h
" |
| 26 #include "third_party/WebKit/Source/Platform/chromium/public/WebImageLayer.h" |
| 27 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 28 #include "third_party/WebKit/Source/Platform/chromium/public/WebScrollbarLayer.h
" |
| 29 #include "third_party/WebKit/Source/Platform/chromium/public/WebSolidColorLayer.
h" |
| 30 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformAnimati
onCurve.h" |
| 31 #include "third_party/WebKit/Source/Platform/chromium/public/WebVideoLayer.h" |
| 32 #endif |
| 33 |
| 34 using WebKit::WebAnimation; |
| 35 using WebKit::WebAnimationCurve; |
| 36 using WebKit::WebContentLayer; |
| 37 using WebKit::WebContentLayerClient; |
| 38 using WebKit::WebExternalTextureLayer; |
| 39 using WebKit::WebExternalTextureLayerClient; |
| 40 using WebKit::WebFloatAnimationCurve; |
| 41 using WebKit::WebIOSurfaceLayer; |
| 42 using WebKit::WebImageLayer; |
| 43 using WebKit::WebImageLayer; |
| 44 using WebKit::WebLayer; |
| 45 using WebKit::WebLayerTreeView; |
| 46 using WebKit::WebLayerTreeViewClient; |
| 47 using WebKit::WebScrollbar; |
| 48 using WebKit::WebScrollbarLayer; |
| 49 using WebKit::WebScrollbarThemeGeometry; |
| 50 using WebKit::WebScrollbarThemePainter; |
| 51 using WebKit::WebSolidColorLayer; |
| 52 using WebKit::WebTransformAnimationCurve; |
| 53 using WebKit::WebVideoFrameProvider; |
| 54 using WebKit::WebVideoLayer; |
| 55 |
| 56 namespace webkit { |
| 57 |
| 58 WebCompositorSupportImpl::WebCompositorSupportImpl() { |
| 59 } |
| 60 |
| 61 WebCompositorSupportImpl::~WebCompositorSupportImpl() { |
| 62 } |
| 63 |
| 64 WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView( |
| 65 WebLayerTreeViewClient* client, const WebLayer& root, |
| 66 const WebLayerTreeView::Settings& settings) { |
| 67 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 68 scoped_ptr<WebKit::WebLayerTreeViewImpl> layerTreeViewImpl( |
| 69 new WebKit::WebLayerTreeViewImpl(client)); |
| 70 if (!layerTreeViewImpl->initialize(settings)) |
| 71 return NULL; |
| 72 layerTreeViewImpl->setRootLayer(root); |
| 73 return layerTreeViewImpl.release(); |
| 74 #else |
| 75 return WebLayerTreeView::create(client, root, settings); |
| 76 #endif |
| 77 } |
| 78 |
| 79 WebLayer* WebCompositorSupportImpl::createLayer() { |
| 80 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 81 return new WebKit::WebLayerImpl(); |
| 82 #else |
| 83 return WebLayer::create(); |
| 84 #endif |
| 85 } |
| 86 |
| 87 WebContentLayer* WebCompositorSupportImpl::createContentLayer( |
| 88 WebContentLayerClient* client) { |
| 89 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 90 return new WebKit::WebContentLayerImpl(client); |
| 91 #else |
| 92 return WebKit::WebContentLayer::create(client); |
| 93 #endif |
| 94 } |
| 95 |
| 96 WebExternalTextureLayer* WebCompositorSupportImpl::createExternalTextureLayer( |
| 97 WebExternalTextureLayerClient* client) { |
| 98 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 99 return new WebKit::WebExternalTextureLayerImpl(client); |
| 100 #else |
| 101 return WebKit::WebExternalTextureLayer::create(client); |
| 102 #endif |
| 103 } |
| 104 |
| 105 WebKit::WebIOSurfaceLayer* |
| 106 WebCompositorSupportImpl::createIOSurfaceLayer() { |
| 107 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 108 return new WebKit::WebIOSurfaceLayerImpl(); |
| 109 #else |
| 110 return WebKit::WebIOSurfaceLayer::create(); |
| 111 #endif |
| 112 } |
| 113 |
| 114 WebKit::WebImageLayer* WebCompositorSupportImpl::createImageLayer() { |
| 115 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 116 return new WebKit::WebImageLayerImpl(); |
| 117 #else |
| 118 return WebKit::WebImageLayer::create(); |
| 119 #endif |
| 120 } |
| 121 |
| 122 WebSolidColorLayer* WebCompositorSupportImpl::createSolidColorLayer() { |
| 123 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 124 return new WebKit::WebSolidColorLayerImpl(); |
| 125 #else |
| 126 return WebKit::WebSolidColorLayer::create(); |
| 127 #endif |
| 128 } |
| 129 |
| 130 WebVideoLayer* WebCompositorSupportImpl::createVideoLayer( |
| 131 WebKit::WebVideoFrameProvider* provider) { |
| 132 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 133 return new WebKit::WebVideoLayerImpl(provider); |
| 134 #else |
| 135 return WebKit::WebVideoLayer::create(provider); |
| 136 #endif |
| 137 } |
| 138 |
| 139 WebScrollbarLayer* WebCompositorSupportImpl::createScrollbarLayer( |
| 140 WebScrollbar* scrollbar, |
| 141 WebScrollbarThemePainter painter, |
| 142 WebScrollbarThemeGeometry* geometry) { |
| 143 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 144 return new WebKit::WebScrollbarLayerImpl(scrollbar, painter, geometry); |
| 145 #else |
| 146 return WebKit::WebScrollbarLayer::create(scrollbar, painter, geometry); |
| 147 #endif |
| 148 } |
| 149 |
| 150 WebAnimation* WebCompositorSupportImpl::createAnimation( |
| 151 const WebKit::WebAnimationCurve& curve, |
| 152 WebKit::WebAnimation::TargetProperty target, |
| 153 int animationId) { |
| 154 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 155 return new WebKit::WebAnimationImpl(curve, target, animationId); |
| 156 #else |
| 157 return WebKit::WebAnimation::create(curve, target, animationId); |
| 158 #endif |
| 159 } |
| 160 |
| 161 WebFloatAnimationCurve* WebCompositorSupportImpl::createFloatAnimationCurve() { |
| 162 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 163 return new WebKit::WebFloatAnimationCurveImpl(); |
| 164 #else |
| 165 return WebKit::WebFloatAnimationCurve::create(); |
| 166 #endif |
| 167 } |
| 168 |
| 169 WebTransformAnimationCurve* |
| 170 WebCompositorSupportImpl::createTransformAnimationCurve() { |
| 171 #if defined(USE_LIBCC_FOR_COMPOSITOR) |
| 172 return new WebKit::WebTransformAnimationCurveImpl(); |
| 173 #else |
| 174 return WebKit::WebTransformAnimationCurve::create(); |
| 175 #endif |
| 176 } |
| 177 |
| 178 } // namespace webkit |
| OLD | NEW |