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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 void TextureImageTransportSurface::SetBufferAllocation( | 150 void TextureImageTransportSurface::SetBufferAllocation( |
151 BufferAllocationState state) { | 151 BufferAllocationState state) { |
152 if (!helper_->MakeCurrent()) | 152 if (!helper_->MakeCurrent()) |
153 return; | 153 return; |
154 switch (state) { | 154 switch (state) { |
155 case BUFFER_ALLOCATION_FRONT_AND_BACK: | 155 case BUFFER_ALLOCATION_FRONT_AND_BACK: |
156 CreateBackTexture(textures_[back()].size); | 156 CreateBackTexture(textures_[back()].size); |
157 break; | 157 break; |
158 case BUFFER_ALLOCATION_FRONT_ONLY: | 158 case BUFFER_ALLOCATION_FRONT_ONLY: |
159 case BUFFER_ALLOCATION_NONE: | 159 case BUFFER_ALLOCATION_NONE: |
160 // TODO(piman): Re-enable this (or something else) when we fix the | 160 ReleaseBackTexture(); |
161 // renderer so it doesn't try to draw/swap on deleted back buffers. | |
162 // ReleaseBackTexture(); | |
163 break; | 161 break; |
164 }; | 162 }; |
165 } | 163 } |
166 | 164 |
167 void* TextureImageTransportSurface::GetShareHandle() { | 165 void* TextureImageTransportSurface::GetShareHandle() { |
168 return GetHandle(); | 166 return GetHandle(); |
169 } | 167 } |
170 | 168 |
171 void* TextureImageTransportSurface::GetDisplay() { | 169 void* TextureImageTransportSurface::GetDisplay() { |
172 return parent_stub_.get() ? parent_stub_->surface()->GetDisplay() : NULL; | 170 return parent_stub_.get() ? parent_stub_->surface()->GetDisplay() : NULL; |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 #endif | 413 #endif |
416 } | 414 } |
417 | 415 |
418 TextureInfo* TextureImageTransportSurface::GetParentInfo(uint32 client_id) { | 416 TextureInfo* TextureImageTransportSurface::GetParentInfo(uint32 client_id) { |
419 DCHECK(parent_stub_.get()); | 417 DCHECK(parent_stub_.get()); |
420 TextureManager* texture_manager = | 418 TextureManager* texture_manager = |
421 parent_stub_->decoder()->GetContextGroup()->texture_manager(); | 419 parent_stub_->decoder()->GetContextGroup()->texture_manager(); |
422 TextureInfo* info = texture_manager->GetTextureInfo(client_id); | 420 TextureInfo* info = texture_manager->GetTextureInfo(client_id); |
423 return info; | 421 return info; |
424 } | 422 } |
OLD | NEW |