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 #include "content/common/gpu/texture_image_transport_surface.h" | 5 #include "content/common/gpu/texture_image_transport_surface.h" |
6 | 6 |
7 #include "content/common/gpu/gpu_channel.h" | 7 #include "content/common/gpu/gpu_channel.h" |
8 #include "content/common/gpu/gpu_channel_manager.h" | 8 #include "content/common/gpu/gpu_channel_manager.h" |
9 #include "content/common/gpu/gpu_messages.h" | 9 #include "content/common/gpu/gpu_messages.h" |
10 #include "gpu/command_buffer/service/context_group.h" | 10 #include "gpu/command_buffer/service/context_group.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 #endif | 140 #endif |
141 } | 141 } |
142 | 142 |
143 return true; | 143 return true; |
144 } | 144 } |
145 | 145 |
146 unsigned int TextureImageTransportSurface::GetBackingFrameBufferObject() { | 146 unsigned int TextureImageTransportSurface::GetBackingFrameBufferObject() { |
147 return fbo_id_; | 147 return fbo_id_; |
148 } | 148 } |
149 | 149 |
150 void TextureImageTransportSurface::SetVisibility(VisibilityState state) { | 150 void TextureImageTransportSurface::SetBufferAllocation( |
| 151 BufferAllocationState state) { |
151 if (!helper_->MakeCurrent()) | 152 if (!helper_->MakeCurrent()) |
152 return; | 153 return; |
153 switch (state) { | 154 switch (state) { |
154 case VISIBILITY_STATE_FOREGROUND: | 155 case BUFFER_ALLOCATION_FRONT_AND_BACK: |
155 CreateBackTexture(textures_[back()].size); | 156 CreateBackTexture(textures_[back()].size); |
156 break; | 157 break; |
157 case VISIBILITY_STATE_BACKGROUND: | 158 case BUFFER_ALLOCATION_FRONT_ONLY: |
158 case VISIBILITY_STATE_HIBERNATED: | 159 case BUFFER_ALLOCATION_NONE: |
159 ReleaseBackTexture(); | 160 ReleaseBackTexture(); |
160 break; | 161 break; |
161 }; | 162 }; |
162 } | 163 } |
163 | 164 |
164 void* TextureImageTransportSurface::GetShareHandle() { | 165 void* TextureImageTransportSurface::GetShareHandle() { |
165 return GetHandle(); | 166 return GetHandle(); |
166 } | 167 } |
167 | 168 |
168 void* TextureImageTransportSurface::GetDisplay() { | 169 void* TextureImageTransportSurface::GetDisplay() { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 #endif | 413 #endif |
413 } | 414 } |
414 | 415 |
415 TextureInfo* TextureImageTransportSurface::GetParentInfo(uint32 client_id) { | 416 TextureInfo* TextureImageTransportSurface::GetParentInfo(uint32 client_id) { |
416 DCHECK(parent_stub_.get()); | 417 DCHECK(parent_stub_.get()); |
417 TextureManager* texture_manager = | 418 TextureManager* texture_manager = |
418 parent_stub_->decoder()->GetContextGroup()->texture_manager(); | 419 parent_stub_->decoder()->GetContextGroup()->texture_manager(); |
419 TextureInfo* info = texture_manager->GetTextureInfo(client_id); | 420 TextureInfo* info = texture_manager->GetTextureInfo(client_id); |
420 return info; | 421 return info; |
421 } | 422 } |
OLD | NEW |