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

Side by Side Diff: ui/compositor/compositor.h

Issue 10453117: Tighter sync and faster ACK on SwapBuffers/PostSubBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698