OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 virtual ~BufferQueue(); | 37 virtual ~BufferQueue(); |
38 | 38 |
39 void Initialize(); | 39 void Initialize(); |
40 | 40 |
41 void BindFramebuffer(); | 41 void BindFramebuffer(); |
42 void SwapBuffers(const gfx::Rect& damage); | 42 void SwapBuffers(const gfx::Rect& damage); |
43 void PageFlipComplete(); | 43 void PageFlipComplete(); |
44 void Reshape(const gfx::Size& size, float scale_factor); | 44 void Reshape(const gfx::Size& size, float scale_factor); |
45 | 45 |
46 unsigned int current_texture_id() const { return current_surface_.texture; } | 46 unsigned int current_texture_id() const { return current_surface_.texture; } |
| 47 unsigned int last_texture_id() const { |
| 48 return in_flight_surfaces_.back().texture; |
| 49 } |
47 unsigned int fbo() const { return fbo_; } | 50 unsigned int fbo() const { return fbo_; } |
48 | 51 |
49 private: | 52 private: |
50 friend class BufferQueueTest; | 53 friend class BufferQueueTest; |
51 | 54 |
52 struct AllocatedSurface { | 55 struct AllocatedSurface { |
53 AllocatedSurface() : texture(0), image(0) {} | 56 AllocatedSurface() : texture(0), image(0) {} |
54 AllocatedSurface(unsigned int texture, | 57 AllocatedSurface(unsigned int texture, |
55 unsigned int image, | 58 unsigned int image, |
56 const gfx::Rect& rect) | 59 const gfx::Rect& rect) |
(...skipping 30 matching lines...) Expand all Loading... |
87 GLHelper* gl_helper_; | 90 GLHelper* gl_helper_; |
88 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager_; | 91 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager_; |
89 int surface_id_; | 92 int surface_id_; |
90 | 93 |
91 DISALLOW_COPY_AND_ASSIGN(BufferQueue); | 94 DISALLOW_COPY_AND_ASSIGN(BufferQueue); |
92 }; | 95 }; |
93 | 96 |
94 } // namespace content | 97 } // namespace content |
95 | 98 |
96 #endif // CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ | 99 #endif // CONTENT_BROWSER_COMPOSITOR_BUFFER_QUEUE_H_ |
OLD | NEW |