Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: gpu/command_buffer/service/texture_definition.cc

Issue 197563003: gpu: Allow fences to check whether a flush has occurred (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if (it->client == client) { 272 if (it->client == client) {
273 it->read_fence = make_linked_ptr(gfx::GLFence::Create()); 273 it->read_fence = make_linked_ptr(gfx::GLFence::Create());
274 return; 274 return;
275 } 275 }
276 } 276 }
277 NOTREACHED(); 277 NOTREACHED();
278 } 278 }
279 279
280 void NativeImageBuffer::DidWrite(gfx::GLImage* client) { 280 void NativeImageBuffer::DidWrite(gfx::GLImage* client) {
281 base::AutoLock lock(lock_); 281 base::AutoLock lock(lock_);
282 // TODO(sievers): crbug.com/352419 282 // Sharing semantics require the client to flush in order to make changes
283 // This is super-risky. We need to somehow find out about when the current 283 // visible to other clients.
284 // context gets flushed, so that we will only ever wait on the write fence
285 // (esp. from another context) if it was flushed and is guaranteed to clear.
286 // On the other hand, proactively flushing here is not feasible in terms
287 // of perf when there are multiple draw calls per frame.
288 write_fence_.reset(gfx::GLFence::CreateWithoutFlush()); 284 write_fence_.reset(gfx::GLFence::CreateWithoutFlush());
289 write_client_ = client; 285 write_client_ = client;
290 for (std::list<ClientInfo>::iterator it = client_infos_.begin(); 286 for (std::list<ClientInfo>::iterator it = client_infos_.begin();
291 it != client_infos_.end(); 287 it != client_infos_.end();
292 it++) { 288 it++) {
293 it->needs_wait_before_read = true; 289 it->needs_wait_before_read = true;
294 } 290 }
295 } 291 }
296 292
297 TextureDefinition::LevelInfo::LevelInfo(GLenum target, 293 TextureDefinition::LevelInfo::LevelInfo(GLenum target,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 432
437 // All structural changes should have orphaned the texture. 433 // All structural changes should have orphaned the texture.
438 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0)) 434 if (image_buffer_ && !texture->GetLevelImage(texture->target(), 0))
439 return false; 435 return false;
440 436
441 return true; 437 return true;
442 } 438 }
443 439
444 } // namespace gles2 440 } // namespace gles2
445 } // namespace gpu 441 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698