| 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 28 matching lines...) Expand all Loading... |
| 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 bool use_stencil); | 64 bool use_stencil); |
| 63 | 65 |
| 64 void RecreateBuffers(); | 66 void RecreateBuffers(); |
| 65 | 67 |
| 68 void ReadbackDisplayedFramebuffer(SkBitmap* bitmap, |
| 69 const base::Callback<void(bool)>& callback); |
| 70 |
| 66 uint32_t current_texture_id() const { | 71 uint32_t current_texture_id() const { |
| 67 return current_surface_ ? current_surface_->texture : 0; | 72 return current_surface_ ? current_surface_->texture : 0; |
| 68 } | 73 } |
| 69 uint32_t fbo() const { return fbo_; } | 74 uint32_t fbo() const { return fbo_; } |
| 70 uint32_t internal_format() const { return internal_format_; } | 75 uint32_t internal_format() const { return internal_format_; } |
| 71 | 76 |
| 72 private: | 77 private: |
| 73 friend class BufferQueueTest; | 78 friend class BufferQueueTest; |
| 74 friend class AllocatedSurface; | 79 friend class AllocatedSurface; |
| 75 | 80 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 GLHelper* gl_helper_; | 135 GLHelper* gl_helper_; |
| 131 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 136 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
| 132 gpu::SurfaceHandle surface_handle_; | 137 gpu::SurfaceHandle surface_handle_; |
| 133 | 138 |
| 134 DISALLOW_COPY_AND_ASSIGN(BufferQueue); | 139 DISALLOW_COPY_AND_ASSIGN(BufferQueue); |
| 135 }; | 140 }; |
| 136 | 141 |
| 137 } // namespace display_compositor | 142 } // namespace display_compositor |
| 138 | 143 |
| 139 #endif // COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ | 144 #endif // COMPONENTS_DISPLAY_COMPOSITOR_BUFFER_QUEUE_H_ |
| OLD | NEW |