OLD | NEW |
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 CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ | 5 #ifndef CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ |
6 #define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ | 6 #define CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 47 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
48 virtual void* GetShareHandle() OVERRIDE; | 48 virtual void* GetShareHandle() OVERRIDE; |
49 virtual void* GetDisplay() OVERRIDE; | 49 virtual void* GetDisplay() OVERRIDE; |
50 virtual void* GetConfig() OVERRIDE; | 50 virtual void* GetConfig() OVERRIDE; |
51 | 51 |
52 protected: | 52 protected: |
53 // ImageTransportSurface implementation. | 53 // ImageTransportSurface implementation. |
54 virtual void OnBufferPresented( | 54 virtual void OnBufferPresented( |
55 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; | 55 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; |
56 virtual void OnResizeViewACK() OVERRIDE; | 56 virtual void OnResizeViewACK() OVERRIDE; |
57 virtual void OnResize(gfx::Size size) OVERRIDE; | 57 virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE; |
58 virtual void SetLatencyInfo( | 58 virtual void SetLatencyInfo( |
59 const cc::LatencyInfo& latency_info) OVERRIDE; | 59 const cc::LatencyInfo& latency_info) OVERRIDE; |
60 | 60 |
61 // GpuCommandBufferStub::DestructionObserver implementation. | 61 // GpuCommandBufferStub::DestructionObserver implementation. |
62 virtual void OnWillDestroyStub() OVERRIDE; | 62 virtual void OnWillDestroyStub() OVERRIDE; |
63 | 63 |
64 private: | 64 private: |
65 | 65 |
66 gfx::Size backbuffer_size() const { | 66 gfx::Size backbuffer_size() const { |
67 return gfx::Size(backbuffer_->level_infos()[0][0].width, | 67 return gfx::Size(backbuffer_->level_infos()[0][0].width, |
(...skipping 18 matching lines...) Expand all Loading... |
86 // The current backbuffer. | 86 // The current backbuffer. |
87 scoped_ptr<gpu::gles2::TextureDefinition> backbuffer_; | 87 scoped_ptr<gpu::gles2::TextureDefinition> backbuffer_; |
88 | 88 |
89 // The mailbox name for the current backbuffer texture. Needs to be unique per | 89 // The mailbox name for the current backbuffer texture. Needs to be unique per |
90 // GL texture and is invalid while service_id is zero. | 90 // GL texture and is invalid while service_id is zero. |
91 gpu::gles2::MailboxName mailbox_name_; | 91 gpu::gles2::MailboxName mailbox_name_; |
92 | 92 |
93 // The current size of the GLSurface. Used to disambiguate from the current | 93 // The current size of the GLSurface. Used to disambiguate from the current |
94 // texture size which might be outdated (since we use two buffers). | 94 // texture size which might be outdated (since we use two buffers). |
95 gfx::Size current_size_; | 95 gfx::Size current_size_; |
| 96 float scale_factor_; |
96 | 97 |
97 // Whether or not the command buffer stub has been destroyed. | 98 // Whether or not the command buffer stub has been destroyed. |
98 bool stub_destroyed_; | 99 bool stub_destroyed_; |
99 | 100 |
100 bool backbuffer_suggested_allocation_; | 101 bool backbuffer_suggested_allocation_; |
101 bool frontbuffer_suggested_allocation_; | 102 bool frontbuffer_suggested_allocation_; |
102 | 103 |
103 scoped_ptr<ImageTransportHelper> helper_; | 104 scoped_ptr<ImageTransportHelper> helper_; |
104 gfx::GLSurfaceHandle handle_; | 105 gfx::GLSurfaceHandle handle_; |
105 | 106 |
(...skipping 13 matching lines...) Expand all Loading... |
119 // Holds a reference to the mailbox manager for cleanup. | 120 // Holds a reference to the mailbox manager for cleanup. |
120 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 121 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
121 | 122 |
122 cc::LatencyInfo latency_info_; | 123 cc::LatencyInfo latency_info_; |
123 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); | 124 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); |
124 }; | 125 }; |
125 | 126 |
126 } // namespace content | 127 } // namespace content |
127 | 128 |
128 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ | 129 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ |
OLD | NEW |