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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/gpu/gpu_command_buffer_stub.h" | 10 #include "content/common/gpu/gpu_command_buffer_stub.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 bool sent_to_client; | 68 bool sent_to_client; |
69 | 69 |
70 // The texture info in the parent stub. | 70 // The texture info in the parent stub. |
71 gpu::gles2::TextureManager::TextureInfo::Ref info; | 71 gpu::gles2::TextureManager::TextureInfo::Ref info; |
72 }; | 72 }; |
73 | 73 |
74 virtual ~TextureImageTransportSurface(); | 74 virtual ~TextureImageTransportSurface(); |
75 void CreateBackTexture(const gfx::Size& size); | 75 void CreateBackTexture(const gfx::Size& size); |
76 void ReleaseBackTexture(); | 76 void ReleaseBackTexture(); |
77 void AttachBackTextureToFBO(); | 77 void AttachBackTextureToFBO(); |
| 78 void ReleaseParentStub(); |
78 int back() const { return 1 - front_; } | 79 int back() const { return 1 - front_; } |
79 | 80 |
80 // The framebuffer that represents this surface (service id). Allocated lazily | 81 // The framebuffer that represents this surface (service id). Allocated lazily |
81 // in OnMakeCurrent. | 82 // in OnMakeCurrent. |
82 uint32 fbo_id_; | 83 uint32 fbo_id_; |
83 | 84 |
84 // The front and back buffers. | 85 // The front and back buffers. |
85 Texture textures_[2]; | 86 Texture textures_[2]; |
86 | 87 |
87 gfx::Rect previous_damage_rect_; | 88 gfx::Rect previous_damage_rect_; |
88 | 89 |
89 // Indicates which of the 2 above is the front buffer. | 90 // Indicates which of the 2 above is the front buffer. |
90 int front_; | 91 int front_; |
91 | 92 |
92 // Whether or not the command buffer stub has been destroyed. | 93 // Whether or not the command buffer stub has been destroyed. |
93 bool stub_destroyed_; | 94 bool stub_destroyed_; |
94 | 95 |
95 scoped_ptr<ImageTransportHelper> helper_; | 96 scoped_ptr<ImageTransportHelper> helper_; |
96 GpuCommandBufferStub* parent_stub_; | 97 GpuCommandBufferStub* parent_stub_; |
97 | 98 |
98 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); | 99 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); |
99 }; | 100 }; |
100 | 101 |
101 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ | 102 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ |
OLD | NEW |