| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
| 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/gfx/compositor/compositor.h" | 11 #include "ui/gfx/compositor/compositor.h" |
| 12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class GLContext; | 15 class GLContext; |
| 16 class GLSurface; | 16 class GLSurface; |
| 17 class Rect; | 17 class Rect; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 | 21 |
| 22 class CompositorGL; | 22 class CompositorGL; |
| 23 class TextureProgramGL; | 23 class TextureProgramGL; |
| 24 | 24 |
| 25 class TextureGL : public Texture { | 25 class COMPOSITOR_EXPORT TextureGL : public Texture { |
| 26 public: | 26 public: |
| 27 explicit TextureGL(CompositorGL* compositor); | 27 explicit TextureGL(CompositorGL* compositor); |
| 28 | 28 |
| 29 virtual void SetCanvas(const SkCanvas& canvas, | 29 virtual void SetCanvas(const SkCanvas& canvas, |
| 30 const gfx::Point& origin, | 30 const gfx::Point& origin, |
| 31 const gfx::Size& overall_size) OVERRIDE; | 31 const gfx::Size& overall_size) OVERRIDE; |
| 32 | 32 |
| 33 // Draws the texture. | 33 // Draws the texture. |
| 34 // TODO(pkotwicz) merge these two methods into one, this method currently | 34 // TODO(pkotwicz) merge these two methods into one, this method currently |
| 35 // doesn't make sense in the context of windows | 35 // doesn't make sense in the context of windows |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 const gfx::Rect& clip_bounds_in_texture); | 49 const gfx::Rect& clip_bounds_in_texture); |
| 50 | 50 |
| 51 unsigned int texture_id_; | 51 unsigned int texture_id_; |
| 52 gfx::Size size_; | 52 gfx::Size size_; |
| 53 CompositorGL* compositor_; | 53 CompositorGL* compositor_; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 DISALLOW_COPY_AND_ASSIGN(TextureGL); | 56 DISALLOW_COPY_AND_ASSIGN(TextureGL); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class CompositorGL : public Compositor { | 59 class COMPOSITOR_EXPORT CompositorGL : public Compositor { |
| 60 public: | 60 public: |
| 61 CompositorGL(gfx::AcceleratedWidget widget, const gfx::Size& size); | 61 CompositorGL(gfx::AcceleratedWidget widget, const gfx::Size& size); |
| 62 virtual ~CompositorGL(); | 62 virtual ~CompositorGL(); |
| 63 | 63 |
| 64 void MakeCurrent(); | 64 void MakeCurrent(); |
| 65 gfx::Size GetSize(); | 65 gfx::Size GetSize(); |
| 66 | 66 |
| 67 TextureProgramGL* program_no_swizzle(); | 67 TextureProgramGL* program_no_swizzle(); |
| 68 TextureProgramGL* program_swizzle(); | 68 TextureProgramGL* program_swizzle(); |
| 69 | 69 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 // Keep track of whether compositing has started or not. | 85 // Keep track of whether compositing has started or not. |
| 86 bool started_; | 86 bool started_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(CompositorGL); | 88 DISALLOW_COPY_AND_ASSIGN(CompositorGL); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace ui | 91 } // namespace ui |
| 92 | 92 |
| 93 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ | 93 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_GL_H_ |
| OLD | NEW |