| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "gpu/command_buffer/service/texture_definition.h" | 5 #include "gpu/command_buffer/service/texture_definition.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/service/texture_manager.h" | 7 #include "gpu/command_buffer/service/texture_manager.h" |
| 8 #include "ui/gl/gl_image.h" | 8 #include "ui/gl/gl_image.h" |
| 9 #include "ui/gl/gl_implementation.h" | 9 #include "ui/gl/gl_implementation.h" |
| 10 #include "ui/gl/scoped_binders.h" | 10 #include "ui/gl/scoped_binders.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 if (it->client == client) { | 271 if (it->client == client) { |
| 272 it->read_fence = make_linked_ptr(gfx::GLFence::Create()); | 272 it->read_fence = make_linked_ptr(gfx::GLFence::Create()); |
| 273 return; | 273 return; |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 NOTREACHED(); | 276 NOTREACHED(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 void NativeImageBuffer::DidWrite(gfx::GLImage* client) { | 279 void NativeImageBuffer::DidWrite(gfx::GLImage* client) { |
| 280 base::AutoLock lock(lock_); | 280 base::AutoLock lock(lock_); |
| 281 // Sharing semantics require the client to flush in order to make changes | 281 // TODO(sievers): crbug.com/352419 |
| 282 // visible to other clients. | 282 // This is super-risky. We need to somehow find out about when the current |
| 283 // context gets flushed, so that we will only ever wait on the write fence |
| 284 // (esp. from another context) if it was flushed and is guaranteed to clear. |
| 285 // On the other hand, proactively flushing here is not feasible in terms |
| 286 // of perf when there are multiple draw calls per frame. |
| 283 write_fence_.reset(gfx::GLFence::CreateWithoutFlush()); | 287 write_fence_.reset(gfx::GLFence::CreateWithoutFlush()); |
| 284 write_client_ = client; | 288 write_client_ = client; |
| 285 for (std::list<ClientInfo>::iterator it = client_infos_.begin(); | 289 for (std::list<ClientInfo>::iterator it = client_infos_.begin(); |
| 286 it != client_infos_.end(); | 290 it != client_infos_.end(); |
| 287 it++) { | 291 it++) { |
| 288 it->needs_wait_before_read = true; | 292 it->needs_wait_before_read = true; |
| 289 } | 293 } |
| 290 } | 294 } |
| 291 | 295 |
| 292 TextureDefinition::LevelInfo::LevelInfo(GLenum target, | 296 TextureDefinition::LevelInfo::LevelInfo(GLenum target, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 435 |
| 432 // All structural changes should have orphaned the texture. | 436 // All structural changes should have orphaned the texture. |
| 433 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0)) | 437 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0)) |
| 434 return false; | 438 return false; |
| 435 | 439 |
| 436 return true; | 440 return true; |
| 437 } | 441 } |
| 438 | 442 |
| 439 } // namespace gles2 | 443 } // namespace gles2 |
| 440 } // namespace gpu | 444 } // namespace gpu |
| OLD | NEW |