Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: ui/compositor/compositor.cc

Issue 11348371: cc: Move WebCompositorOutputSurface and related classes into cc/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forlanding6 Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/compositor.h ('k') | webkit/compositor_bindings/compositor_bindings.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/compositor.cc
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index 14f6a1b1a18ddc237d37cca906bf6da8d9ad04e7..bc8491e401e9f4f70e685bc14c9cfb5d0a5bf5fb 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -16,9 +16,9 @@
#include "cc/input_handler.h"
#include "cc/layer.h"
#include "cc/layer_tree_host.h"
+#include "cc/output_surface.h"
#include "cc/thread_impl.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurface.h"
#include "ui/compositor/compositor_observer.h"
#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/dip_util.h"
@@ -52,9 +52,9 @@ ui::ContextFactory* g_context_factory = NULL;
const int kCompositorLockTimeoutMs = 67;
-// Adapts a pure WebGraphicsContext3D into a WebCompositorOutputSurface.
+// Adapts a pure WebGraphicsContext3D into a cc::OutputSurface.
class WebGraphicsContextToOutputSurfaceAdapter
- : public WebKit::WebCompositorOutputSurface {
+ : public cc::OutputSurface {
public:
explicit WebGraphicsContextToOutputSurfaceAdapter(
WebKit::WebGraphicsContext3D* context)
@@ -62,8 +62,8 @@ class WebGraphicsContextToOutputSurfaceAdapter
client_(NULL) {
}
- virtual bool bindToClient(
- WebKit::WebCompositorOutputSurfaceClient* client) OVERRIDE {
+ virtual bool BindToClient(
+ cc::OutputSurfaceClient* client) OVERRIDE {
DCHECK(client);
if (!context3D_->makeContextCurrent())
return false;
@@ -71,22 +71,26 @@ class WebGraphicsContextToOutputSurfaceAdapter
return true;
}
- virtual const Capabilities& capabilities() const OVERRIDE {
+ virtual const struct Capabilities& Capabilities() const OVERRIDE {
return capabilities_;
}
- virtual WebKit::WebGraphicsContext3D* context3D() const OVERRIDE {
+ virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE {
return context3D_.get();
}
- virtual void sendFrameToParentCompositor(
- const WebKit::WebCompositorFrame&) OVERRIDE {
+ virtual cc::SoftwareOutputDevice* SoftwareDevice() const OVERRIDE {
+ return NULL;
+ }
+
+ virtual void SendFrameToParentCompositor(
+ const cc::CompositorFrame&) OVERRIDE {
}
private:
scoped_ptr<WebKit::WebGraphicsContext3D> context3D_;
- Capabilities capabilities_;
- WebKit::WebCompositorOutputSurfaceClient* client_;
+ struct Capabilities capabilities_;
+ cc::OutputSurfaceClient* client_;
};
class PendingSwap {
@@ -149,7 +153,7 @@ bool DefaultContextFactory::Initialize() {
return true;
}
-WebKit::WebCompositorOutputSurface* DefaultContextFactory::CreateOutputSurface(
+cc::OutputSurface* DefaultContextFactory::CreateOutputSurface(
Compositor* compositor) {
return new WebGraphicsContextToOutputSurfaceAdapter(
CreateContextCommon(compositor, false));
@@ -497,16 +501,15 @@ void Compositor::applyScrollAndScale(gfx::Vector2d scrollDelta,
float pageScale) {
}
-scoped_ptr<WebKit::WebCompositorOutputSurface>
-Compositor::createOutputSurface() {
+scoped_ptr<cc::OutputSurface> Compositor::createOutputSurface() {
if (test_compositor_enabled) {
ui::TestWebGraphicsContext3D* test_context =
new ui::TestWebGraphicsContext3D();
test_context->Initialize();
- return scoped_ptr<WebKit::WebCompositorOutputSurface>(
+ return scoped_ptr<cc::OutputSurface>(
new WebGraphicsContextToOutputSurfaceAdapter(test_context));
} else {
- return scoped_ptr<WebKit::WebCompositorOutputSurface>(
+ return scoped_ptr<cc::OutputSurface>(
ContextFactory::GetInstance()->CreateOutputSurface(this));
}
}
« no previous file with comments | « ui/compositor/compositor.h ('k') | webkit/compositor_bindings/compositor_bindings.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698