| 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" |
| 11 #include "content/common/gpu/gpu_command_buffer_stub.h" | 11 #include "content/common/gpu/gpu_command_buffer_stub.h" |
| 12 #include "content/common/gpu/image_transport_surface.h" | 12 #include "content/common/gpu/image_transport_surface.h" |
| 13 #include "gpu/command_buffer/common/mailbox.h" | |
| 14 #include "gpu/command_buffer/service/mailbox_manager.h" | 13 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 15 #include "gpu/command_buffer/service/texture_manager.h" | 14 #include "gpu/command_buffer/service/texture_manager.h" |
| 16 #include "ui/gl/gl_context.h" | 15 #include "ui/gl/gl_context.h" |
| 17 #include "ui/gl/gl_surface.h" | 16 #include "ui/gl/gl_surface.h" |
| 18 | 17 |
| 19 namespace content { | 18 namespace content { |
| 20 class GpuChannelManager; | 19 class GpuChannelManager; |
| 21 | 20 |
| 22 class TextureImageTransportSurface | 21 class TextureImageTransportSurface |
| 23 : public ImageTransportSurface, | 22 : public ImageTransportSurface, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ~Texture(); | 64 ~Texture(); |
| 66 | 65 |
| 67 // The currently allocated size. | 66 // The currently allocated size. |
| 68 gfx::Size size; | 67 gfx::Size size; |
| 69 | 68 |
| 70 // The actual GL texture id. | 69 // The actual GL texture id. |
| 71 uint32 service_id; | 70 uint32 service_id; |
| 72 | 71 |
| 73 // The mailbox name for the current service_id. Needs to be unique per | 72 // The mailbox name for the current service_id. Needs to be unique per |
| 74 // GL texture and is invalid while service_id is zero. | 73 // GL texture and is invalid while service_id is zero. |
| 75 gpu::Mailbox mailbox_name; | 74 gpu::gles2::MailboxName mailbox_name; |
| 76 }; | 75 }; |
| 77 | 76 |
| 78 virtual ~TextureImageTransportSurface(); | 77 virtual ~TextureImageTransportSurface(); |
| 79 void CreateBackTexture(); | 78 void CreateBackTexture(); |
| 80 void AttachBackTextureToFBO(); | 79 void AttachBackTextureToFBO(); |
| 81 void ReleaseBackTexture(); | 80 void ReleaseBackTexture(); |
| 82 void BufferPresentedImpl(const gpu::Mailbox& mailbox_name); | 81 void BufferPresentedImpl(const std::string& mailbox_name); |
| 83 void ProduceTexture(Texture* texture); | 82 void ProduceTexture(Texture* texture); |
| 84 void ConsumeTexture(Texture* texture); | 83 void ConsumeTexture(Texture* texture); |
| 85 | 84 |
| 86 // The framebuffer that represents this surface (service id). Allocated lazily | 85 // The framebuffer that represents this surface (service id). Allocated lazily |
| 87 // in OnMakeCurrent. | 86 // in OnMakeCurrent. |
| 88 uint32 fbo_id_; | 87 uint32 fbo_id_; |
| 89 | 88 |
| 90 // The current backbuffer. | 89 // The current backbuffer. |
| 91 Texture backbuffer_; | 90 Texture backbuffer_; |
| 92 | 91 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 118 | 117 |
| 119 // Holds a reference to the mailbox manager for cleanup. | 118 // Holds a reference to the mailbox manager for cleanup. |
| 120 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 119 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 121 | 120 |
| 122 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); | 121 DISALLOW_COPY_AND_ASSIGN(TextureImageTransportSurface); |
| 123 }; | 122 }; |
| 124 | 123 |
| 125 } // namespace content | 124 } // namespace content |
| 126 | 125 |
| 127 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ | 126 #endif // CONTENT_COMMON_GPU_TEXTURE_IMAGE_TRANSPORT_SURFACE_H_ |
| OLD | NEW |