| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_ |
| 6 #define UI_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_COMPOSITOR_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 scoped_refptr<gfx::GLShareGroup> share_group_; | 88 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(DefaultContextFactory); | 90 DISALLOW_COPY_AND_ASSIGN(DefaultContextFactory); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // Texture provide an abstraction over the external texture that can be passed | 93 // Texture provide an abstraction over the external texture that can be passed |
| 94 // to a layer. | 94 // to a layer. |
| 95 class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { | 95 class COMPOSITOR_EXPORT Texture : public base::RefCounted<Texture> { |
| 96 public: | 96 public: |
| 97 Texture(bool flipped, const gfx::Size& size); | 97 Texture(bool flipped, const gfx::Size& size, float device_scale_factor); |
| 98 | 98 |
| 99 unsigned int texture_id() const { return texture_id_; } | 99 unsigned int texture_id() const { return texture_id_; } |
| 100 void set_texture_id(unsigned int id) { texture_id_ = id; } | 100 void set_texture_id(unsigned int id) { texture_id_ = id; } |
| 101 bool flipped() const { return flipped_; } | 101 bool flipped() const { return flipped_; } |
| 102 gfx::Size size() const { return size_; } | 102 gfx::Size size() const { return size_; } |
| 103 float device_scale_factor() const { return device_scale_factor_; } |
| 103 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; | 104 virtual WebKit::WebGraphicsContext3D* HostContext3D() = 0; |
| 104 | 105 |
| 105 protected: | 106 protected: |
| 106 virtual ~Texture(); | 107 virtual ~Texture(); |
| 107 | 108 |
| 108 private: | 109 private: |
| 109 friend class base::RefCounted<Texture>; | 110 friend class base::RefCounted<Texture>; |
| 110 | 111 |
| 111 unsigned int texture_id_; | 112 unsigned int texture_id_; |
| 112 bool flipped_; | 113 bool flipped_; |
| 113 gfx::Size size_; // in pixel | 114 gfx::Size size_; // in pixel |
| 115 float device_scale_factor_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(Texture); | 117 DISALLOW_COPY_AND_ASSIGN(Texture); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 // An interface to allow the compositor to communicate with its owner. | 120 // An interface to allow the compositor to communicate with its owner. |
| 119 class COMPOSITOR_EXPORT CompositorDelegate { | 121 class COMPOSITOR_EXPORT CompositorDelegate { |
| 120 public: | 122 public: |
| 121 // Requests the owner to schedule a redraw of the layer tree. | 123 // Requests the owner to schedule a redraw of the layer tree. |
| 122 virtual void ScheduleDraw() = 0; | 124 virtual void ScheduleDraw() = 0; |
| 123 | 125 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 int last_ended_frame_; | 253 int last_ended_frame_; |
| 252 | 254 |
| 253 bool disable_schedule_composite_; | 255 bool disable_schedule_composite_; |
| 254 | 256 |
| 255 DISALLOW_COPY_AND_ASSIGN(Compositor); | 257 DISALLOW_COPY_AND_ASSIGN(Compositor); |
| 256 }; | 258 }; |
| 257 | 259 |
| 258 } // namespace ui | 260 } // namespace ui |
| 259 | 261 |
| 260 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 262 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |