diff options
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/compositor/compositor.h | 42 | ||||
-rw-r--r-- | ui/gfx/compositor/compositor_gl.cc | 67 |
2 files changed, 0 insertions, 109 deletions
diff --git a/ui/gfx/compositor/compositor.h b/ui/gfx/compositor/compositor.h index 12b2e68..2c71b4a 100644 --- a/ui/gfx/compositor/compositor.h +++ b/ui/gfx/compositor/compositor.h @@ -19,47 +19,6 @@ class Size; namespace ui { class Transform; -#if !defined(COMPOSITOR_2) -typedef unsigned int TextureID; - -// NOTE: all coordinates passed to Texture/Compositor have 0x0 as the upper left -// corner. - -// Compositor object to take care of GPU painting. -// A Browser compositor object is responsible for generating the final -// displayable form of pixels comprising a single widget's contents. It draws an -// appropriately transformed texture for each transformed view in the widget's -// view hierarchy. The initial implementation uses GL for this purpose. -// Future CLs will adapt this to ongoing Skia development. -class Compositor : public base::RefCounted<Compositor> { - public: - // Create a compositor from the provided handle. - static Compositor* Create(gfx::AcceleratedWidget widget); - - // Notifies the compositor that compositing is about to start. - virtual void NotifyStart() = 0; - - // Notifies the compositor that compositing is complete. - virtual void NotifyEnd() = 0; - - // Draws the given texture with the given transform. - virtual void DrawTextureWithTransform(TextureID txt, - const ui::Transform& transform) = 0; - - // Save the current transformation that can be restored with RestoreTransform. - virtual void SaveTransform() = 0; - - // Restore a previously saved transformation using SaveTransform. - virtual void RestoreTransform() = 0; - - protected: - virtual ~Compositor() {} - - private: - friend class base::RefCounted<Compositor>; -}; - -#else // Textures are created by a Compositor for managing an accelerated view. // Any time a View with a texture needs to redraw itself it invokes SetBitmap(). // When the view is ready to be drawn Draw() is invoked. @@ -111,7 +70,6 @@ class Compositor : public base::RefCounted<Compositor> { friend class base::RefCounted<Compositor>; }; -#endif // COMPOSITOR_2 } // namespace ui #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ diff --git a/ui/gfx/compositor/compositor_gl.cc b/ui/gfx/compositor/compositor_gl.cc index e591e2a..5c68add 100644 --- a/ui/gfx/compositor/compositor_gl.cc +++ b/ui/gfx/compositor/compositor_gl.cc @@ -23,7 +23,6 @@ namespace ui { -#if defined COMPOSITOR_2 namespace glHidden { class CompositorGL; @@ -362,71 +361,5 @@ Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { return new glHidden::CompositorGL(widget); return NULL; } -#else -class CompositorGL : public Compositor { - public: - explicit CompositorGL(gfx::AcceleratedWidget widget); - - private: - // Overridden from Compositor. - void NotifyStart() OVERRIDE; - void NotifyEnd() OVERRIDE; - void DrawTextureWithTransform(TextureID txt, - const ui::Transform& transform) OVERRIDE; - void SaveTransform() OVERRIDE; - void RestoreTransform() OVERRIDE; - - // The GL context used for compositing. - scoped_refptr<gfx::GLSurface> gl_surface_; - scoped_refptr<gfx::GLContext> gl_context_; - - // Keep track of whether compositing has started or not. - bool started_; - - DISALLOW_COPY_AND_ASSIGN(CompositorGL); -}; - -CompositorGL::CompositorGL(gfx::AcceleratedWidget widget) - : started_(false) { - gl_surface_ = gfx::GLSurface::CreateViewGLSurface(widget); - gl_context_ = gfx::GLContext::CreateGLContext(NULL, gl_surface_.get()); -} - -void CompositorGL::NotifyStart() { - started_ = true; - gl_context_->MakeCurrent(gl_surface_.get()); -} - -void CompositorGL::NotifyEnd() { - DCHECK(started_); - gl_surface_->SwapBuffers(); - started_ = false; -} - -void CompositorGL::DrawTextureWithTransform(TextureID txt, - const ui::Transform& transform) { - DCHECK(started_); - - // TODO(wjmaclean): - NOTIMPLEMENTED(); -} - -void CompositorGL::SaveTransform() { - // TODO(sadrul): - NOTIMPLEMENTED(); -} - -void CompositorGL::RestoreTransform() { - // TODO(sadrul): - NOTIMPLEMENTED(); -} - -// static -Compositor* Compositor::Create(gfx::AcceleratedWidget widget) { - if (gfx::GetGLImplementation() != gfx::kGLImplementationNone) - return new CompositorGL(widget); - return NULL; -} -#endif } // namespace ui |