| 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_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ | 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
| 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ | 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
| 7 | 7 |
| 8 #include "base/mac/scoped_cftyperef.h" | 8 #include "base/mac/scoped_cftyperef.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/common/gpu/gpu_command_buffer_stub.h" | 10 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual void SwapBuffersAckedByBrowser(bool disable_throttling) = 0; | 62 virtual void SwapBuffersAckedByBrowser(bool disable_throttling) = 0; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 ImageTransportSurfaceFBO(GpuChannelManager* manager, | 65 ImageTransportSurfaceFBO(GpuChannelManager* manager, |
| 66 GpuCommandBufferStub* stub, | 66 GpuCommandBufferStub* stub, |
| 67 gfx::PluginWindowHandle handle); | 67 gfx::PluginWindowHandle handle); |
| 68 | 68 |
| 69 // GLSurface implementation | 69 // GLSurface implementation |
| 70 bool Initialize() override; | 70 bool Initialize() override; |
| 71 void Destroy() override; | 71 void Destroy() override; |
| 72 bool Resize(const gfx::Size& pixel_size, float scale_factor) override; |
| 72 bool DeferDraws() override; | 73 bool DeferDraws() override; |
| 73 bool IsOffscreen() override; | 74 bool IsOffscreen() override; |
| 74 gfx::SwapResult SwapBuffers() override; | 75 gfx::SwapResult SwapBuffers() override; |
| 75 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 76 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 76 bool SupportsPostSubBuffer() override; | 77 bool SupportsPostSubBuffer() override; |
| 77 gfx::Size GetSize() override; | 78 gfx::Size GetSize() override; |
| 78 void* GetHandle() override; | 79 void* GetHandle() override; |
| 79 void* GetDisplay() override; | 80 void* GetDisplay() override; |
| 80 bool OnMakeCurrent(gfx::GLContext* context) override; | 81 bool OnMakeCurrent(gfx::GLContext* context) override; |
| 81 void NotifyWasBound() override; | 82 void NotifyWasBound() override; |
| 82 unsigned int GetBackingFrameBufferObject() override; | 83 unsigned int GetBackingFrameBufferObject() override; |
| 83 bool SetBackbufferAllocation(bool allocated) override; | 84 bool SetBackbufferAllocation(bool allocated) override; |
| 84 void SetFrontbufferAllocation(bool allocated) override; | 85 void SetFrontbufferAllocation(bool allocated) override; |
| 85 | 86 |
| 86 // Called when the context may continue to make forward progress after a swap. | 87 // Called when the context may continue to make forward progress after a swap. |
| 87 void SendSwapBuffers(uint64 surface_handle, | 88 void SendSwapBuffers(uint64 surface_handle, |
| 88 const gfx::Size pixel_size, | 89 const gfx::Size pixel_size, |
| 89 float scale_factor); | 90 float scale_factor); |
| 90 void SetRendererID(int renderer_id); | 91 void SetRendererID(int renderer_id); |
| 91 | 92 |
| 92 const gpu::gles2::FeatureInfo* GetFeatureInfo() const; | 93 const gpu::gles2::FeatureInfo* GetFeatureInfo() const; |
| 93 | 94 |
| 94 protected: | 95 protected: |
| 95 // ImageTransportSurface implementation | 96 // ImageTransportSurface implementation |
| 96 void OnBufferPresented( | 97 void OnBufferPresented( |
| 97 const AcceleratedSurfaceMsg_BufferPresented_Params& params) override; | 98 const AcceleratedSurfaceMsg_BufferPresented_Params& params) override; |
| 98 void OnResize(gfx::Size pixel_size, float scale_factor) override; | |
| 99 void SetLatencyInfo(const std::vector<ui::LatencyInfo>&) override; | 99 void SetLatencyInfo(const std::vector<ui::LatencyInfo>&) override; |
| 100 | 100 |
| 101 // GpuCommandBufferStub::DestructionObserver implementation. | 101 // GpuCommandBufferStub::DestructionObserver implementation. |
| 102 void OnWillDestroyStub() override; | 102 void OnWillDestroyStub() override; |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 ~ImageTransportSurfaceFBO() override; | 105 ~ImageTransportSurfaceFBO() override; |
| 106 | 106 |
| 107 void AdjustBufferAllocation(); | 107 void AdjustBufferAllocation(); |
| 108 void DestroyFramebuffer(); | 108 void DestroyFramebuffer(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 137 gfx::Rect pending_swap_pixel_damage_rect_; | 137 gfx::Rect pending_swap_pixel_damage_rect_; |
| 138 | 138 |
| 139 scoped_ptr<ImageTransportHelper> helper_; | 139 scoped_ptr<ImageTransportHelper> helper_; |
| 140 | 140 |
| 141 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); | 141 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace content | 144 } // namespace content |
| 145 | 145 |
| 146 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ | 146 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
| OLD | NEW |