Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 virtual void updateAnimations(double frameBeginTime); | 207 virtual void updateAnimations(double frameBeginTime); |
| 208 virtual void layout(); | 208 virtual void layout(); |
| 209 virtual void applyScrollAndScale(const WebKit::WebSize& scrollDelta, | 209 virtual void applyScrollAndScale(const WebKit::WebSize& scrollDelta, |
| 210 float scaleFactor); | 210 float scaleFactor); |
| 211 virtual WebKit::WebGraphicsContext3D* createContext3D(); | 211 virtual WebKit::WebGraphicsContext3D* createContext3D(); |
| 212 virtual void didRebindGraphicsContext(bool success); | 212 virtual void didRebindGraphicsContext(bool success); |
| 213 virtual void didCommitAndDrawFrame(); | 213 virtual void didCommitAndDrawFrame(); |
| 214 virtual void didCompleteSwapBuffers(); | 214 virtual void didCompleteSwapBuffers(); |
| 215 virtual void scheduleComposite(); | 215 virtual void scheduleComposite(); |
| 216 | 216 |
| 217 int last_started_id() { return last_started_id_; } | |
| 218 int last_will_end_id() { return last_will_end_id_; } | |
| 219 int last_ended_id() { return last_ended_id_; } | |
| 220 | |
| 217 private: | 221 private: |
| 218 friend class base::RefCounted<Compositor>; | 222 friend class base::RefCounted<Compositor>; |
| 219 | 223 |
| 220 // When reading back pixel data we often get RGBA rather than BGRA pixels and | 224 // When reading back pixel data we often get RGBA rather than BGRA pixels and |
| 221 // and the image often needs to be flipped vertically. | 225 // and the image often needs to be flipped vertically. |
| 222 static void SwizzleRGBAToBGRAAndFlip(unsigned char* pixels, | 226 static void SwizzleRGBAToBGRAAndFlip(unsigned char* pixels, |
| 223 const gfx::Size& image_size); | 227 const gfx::Size& image_size); |
| 224 | 228 |
| 225 // Notifies the compositor that compositing is complete. | 229 // Notifies the compositor that compositing is complete. |
| 226 void NotifyEnd(); | 230 void NotifyEnd(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 237 WebKit::WebLayer root_web_layer_; | 241 WebKit::WebLayer root_web_layer_; |
| 238 WebKit::WebLayerTreeView host_; | 242 WebKit::WebLayerTreeView host_; |
| 239 | 243 |
| 240 // This is set to true when the swap buffers has been posted and we're waiting | 244 // This is set to true when the swap buffers has been posted and we're waiting |
| 241 // for completion. | 245 // for completion. |
| 242 bool swap_posted_; | 246 bool swap_posted_; |
| 243 | 247 |
| 244 // The device scale factor of the monitor that this compositor is compositing | 248 // The device scale factor of the monitor that this compositor is compositing |
| 245 // layers on. | 249 // layers on. |
| 246 float device_scale_factor_; | 250 float device_scale_factor_; |
| 251 | |
| 252 int last_started_id_; | |
|
piman
2012/06/04 18:20:39
naming bikeshedding: mind calling these last_start
| |
| 253 int last_will_end_id_; | |
| 254 int last_ended_id_; | |
| 247 }; | 255 }; |
| 248 | 256 |
| 249 } // namespace ui | 257 } // namespace ui |
| 250 | 258 |
| 251 #endif // UI_COMPOSITOR_COMPOSITOR_H_ | 259 #endif // UI_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |