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

Side by Side Diff: gpu/command_buffer/service/mailbox_synchronizer.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: line brk 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/mailbox_synchronizer.h" 5 #include "gpu/command_buffer/service/mailbox_synchronizer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "gpu/command_buffer/service/mailbox_manager.h" 8 #include "gpu/command_buffer/service/mailbox_manager.h"
9 #include "gpu/command_buffer/service/texture_manager.h" 9 #include "gpu/command_buffer/service/texture_manager.h"
10 #include "ui/gl/gl_implementation.h" 10 #include "ui/gl/gl_implementation.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 } else { 168 } else {
169 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup( 169 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup(
170 TextureDefinition(target_name.target, texture, 1, NULL))); 170 TextureDefinition(target_name.target, texture, 1, NULL)));
171 171
172 // Unlink other textures from this mailbox in case the name is not new. 172 // Unlink other textures from this mailbox in case the name is not new.
173 ReassociateMailboxLocked(target_name, group.get()); 173 ReassociateMailboxLocked(target_name, group.get());
174 textures_.insert(std::make_pair(texture, TextureVersion(group))); 174 textures_.insert(std::make_pair(texture, TextureVersion(group)));
175 } 175 }
176 } 176 }
177 // Make sure all write fences are flushed.
178 glFlush();
179 } 177 }
180 178
181 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture, 179 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture,
182 TextureVersion& texture_version) { 180 TextureVersion& texture_version) {
183 lock_.AssertAcquired(); 181 lock_.AssertAcquired();
184 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0); 182 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0);
185 TextureGroup* group = texture_version.group.get(); 183 TextureGroup* group = texture_version.group.get();
186 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image(); 184 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image();
187 185
188 // Make sure we don't clobber with an older version 186 // Make sure we don't clobber with an older version
(...skipping 30 matching lines...) Expand all
219 definition.IsOlderThan(it->second.version)) 217 definition.IsOlderThan(it->second.version))
220 continue; 218 continue;
221 it->second.version = definition.version(); 219 it->second.version = definition.version();
222 definition.UpdateTexture(texture); 220 definition.UpdateTexture(texture);
223 } 221 }
224 } 222 }
225 } 223 }
226 224
227 } // namespace gles2 225 } // namespace gles2
228 } // namespace gpu 226 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/mailbox_manager_unittest.cc ('k') | gpu/command_buffer/service/texture_definition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698