| 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 COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ | 5 #ifndef COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ |
| 6 #define COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ | 6 #define COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 16 #include "components/display_compositor/display_compositor_export.h" | 17 #include "components/display_compositor/display_compositor_export.h" |
| 17 #include "gpu/ipc/common/surface_handle.h" | 18 #include "gpu/ipc/common/surface_handle.h" |
| 19 #include "third_party/skia/include/core/SkBitmap.h" |
| 18 #include "ui/gfx/buffer_types.h" | 20 #include "ui/gfx/buffer_types.h" |
| 19 #include "ui/gfx/color_space.h" | 21 #include "ui/gfx/color_space.h" |
| 20 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 21 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
| 22 | 24 |
| 23 namespace gfx { | 25 namespace gfx { |
| 24 class GpuMemoryBuffer; | 26 class GpuMemoryBuffer; |
| 25 } | 27 } |
| 26 | 28 |
| 27 namespace gpu { | 29 namespace gpu { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 55 | 57 |
| 56 void BindFramebuffer(); | 58 void BindFramebuffer(); |
| 57 void SwapBuffers(const gfx::Rect& damage); | 59 void SwapBuffers(const gfx::Rect& damage); |
| 58 void PageFlipComplete(); | 60 void PageFlipComplete(); |
| 59 void Reshape(const gfx::Size& size, | 61 void Reshape(const gfx::Size& size, |
| 60 float scale_factor, | 62 float scale_factor, |
| 61 const gfx::ColorSpace& color_space); | 63 const gfx::ColorSpace& color_space); |
| 62 | 64 |
| 63 void RecreateBuffers(); | 65 void RecreateBuffers(); |
| 64 | 66 |
| 67 void ReadbackDisplayedFramebuffer(SkBitmap* bitmap, |
| 68 const base::Callback<void(bool)>& callback); |
| 69 |
| 65 uint32_t current_texture_id() const { | 70 uint32_t current_texture_id() const { |
| 66 return current_surface_ ? current_surface_->texture : 0; | 71 return current_surface_ ? current_surface_->texture : 0; |
| 67 } | 72 } |
| 68 uint32_t fbo() const { return fbo_; } | 73 uint32_t fbo() const { return fbo_; } |
| 69 uint32_t internal_format() const { return internal_format_; } | 74 uint32_t internal_format() const { return internal_format_; } |
| 70 | 75 |
| 71 private: | 76 private: |
| 72 friend class BufferQueueTest; | 77 friend class BufferQueueTest; |
| 73 friend class AllocatedSurface; | 78 friend class AllocatedSurface; |
| 74 | 79 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 GLHelper* gl_helper_; | 131 GLHelper* gl_helper_; |
| 127 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 132 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 128 gpu::SurfaceHandle surface_handle_; | 133 gpu::SurfaceHandle surface_handle_; |
| 129 | 134 |
| 130 DISALLOW_COPY_AND_ASSIGN(BufferQueue); | 135 DISALLOW_COPY_AND_ASSIGN(BufferQueue); |
| 131 }; | 136 }; |
| 132 | 137 |
| 133 } // namespace display_compositor | 138 } // namespace display_compositor |
| 134 | 139 |
| 135 #endif // COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ | 140 #endif // COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ |
| OLD | NEW |