diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 21:13:03 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-10 21:13:03 +0000 |
commit | fa7e889d9a7cb5b0b9bc7c0f89fb4e496663db4b (patch) | |
tree | 50208bf8b01c9b03777c363cd5e4a1184e044236 /ui/compositor | |
parent | 9308ca82cac7d13f211078c45eaa6edb91908091 (diff) | |
download | chromium_src-fa7e889d9a7cb5b0b9bc7c0f89fb4e496663db4b.zip chromium_src-fa7e889d9a7cb5b0b9bc7c0f89fb4e496663db4b.tar.gz chromium_src-fa7e889d9a7cb5b0b9bc7c0f89fb4e496663db4b.tar.bz2 |
use WebKit::WebCompositorSupport to instantiate Web*Layer* types
The static factory Web*Layer*::create() functions are going away since their implementation is moving out of
WebKit.dll. Instead, these types can be constructed by the WebCompositorSupport interfaces that hangs off of
WebKit platform support.
In due time, the ui/compositor/ code can be ported to something more direct that doesn't involve WebKit at all.
BUG=
Review URL: https://chromiumcodereview.appspot.com/10914164
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/compositor')
-rw-r--r-- | ui/compositor/compositor.cc | 10 | ||||
-rw-r--r-- | ui/compositor/layer.cc | 15 |
2 files changed, 18 insertions, 7 deletions
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc index 0aea241..3bc4b7c 100644 --- a/ui/compositor/compositor.cc +++ b/ui/compositor/compositor.cc @@ -10,6 +10,8 @@ #include "base/threading/thread_restrictions.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/images/SkImageEncoder.h" +#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" @@ -138,12 +140,14 @@ Compositor::Compositor(CompositorDelegate* delegate, : delegate_(delegate), root_layer_(NULL), widget_(widget), - root_web_layer_(WebKit::WebLayer::create()), swap_posted_(false), device_scale_factor_(0.0f), last_started_frame_(0), last_ended_frame_(0), disable_schedule_composite_(false) { + WebKit::WebCompositorSupport* compositor_support = + WebKit::Platform::current()->compositorSupport(); + root_web_layer_.reset(compositor_support->createLayer()); WebKit::WebLayerTreeView::Settings settings; CommandLine* command_line = CommandLine::ForCurrentProcess(); settings.showFPSCounter = @@ -154,8 +158,8 @@ Compositor::Compositor(CompositorDelegate* delegate, test_compositor_enabled ? kTestRefreshRate : kDefaultRefreshRate; root_web_layer_->setAnchorPoint(WebKit::WebFloatPoint(0.f, 0.f)); - host_.reset(WebKit::WebLayerTreeView::create(this, *root_web_layer_, - settings)); + host_.reset(compositor_support->createLayerTreeView(this, *root_web_layer_, + settings)); host_->setSurfaceReady(); } diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index 67d4ca7..7e79649 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc @@ -10,6 +10,8 @@ #include "base/debug/trace_event.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" +#include "third_party/WebKit/Source/Platform/chromium/public/Platform.h" +#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorSupport.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebContentLayer.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebExternalTextureLayer.h" #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation.h" @@ -386,13 +388,16 @@ void Layer::SetExternalTexture(Texture* texture) { scoped_ptr<WebKit::WebExternalTextureLayer> old_texture_layer( texture_layer_.release()); WebKit::WebLayer* new_layer = NULL; + WebKit::WebCompositorSupport* compositor_support = + WebKit::Platform::current()->compositorSupport(); if (layer_updated_externally_) { - texture_layer_.reset(WebKit::WebExternalTextureLayer::create(this)); + texture_layer_.reset( + compositor_support->createExternalTextureLayer(this)); texture_layer_->setFlipped(texture_->flipped()); new_layer = texture_layer_->layer(); } else { old_texture_layer->willModifyTexture(); - content_layer_.reset(WebKit::WebContentLayer::create(this)); + content_layer_.reset(compositor_support->createContentLayer(this)); new_layer = content_layer_->layer(); } if (parent_) { @@ -699,11 +704,13 @@ float Layer::GetGrayscaleForAnimation() const { } void Layer::CreateWebLayer() { + WebKit::WebCompositorSupport* compositor_support = + WebKit::Platform::current()->compositorSupport(); if (type_ == LAYER_SOLID_COLOR) { - solid_color_layer_.reset(WebKit::WebSolidColorLayer::create()); + solid_color_layer_.reset(compositor_support->createSolidColorLayer()); web_layer_ = solid_color_layer_->layer(); } else { - content_layer_.reset(WebKit::WebContentLayer::create(this)); + content_layer_.reset(compositor_support->createContentLayer(this)); web_layer_ = content_layer_->layer(); } web_layer_is_accelerated_ = false; |