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

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: 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
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_definition.cc » ('j') | ui/gl/gl_context.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 } else { 144 } else {
145 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup( 145 linked_ptr<TextureGroup> group = make_linked_ptr(new TextureGroup(
146 TextureDefinition(target_name.target, texture, 1, NULL))); 146 TextureDefinition(target_name.target, texture, 1, NULL)));
147 147
148 // Unlink other textures from this mailbox in case the name is not new. 148 // Unlink other textures from this mailbox in case the name is not new.
149 ReassociateMailboxLocked(target_name, group.get()); 149 ReassociateMailboxLocked(target_name, group.get());
150 textures_.insert(std::make_pair(texture, TextureVersion(group))); 150 textures_.insert(std::make_pair(texture, TextureVersion(group)));
151 } 151 }
152 } 152 }
153 // Make sure all write fences are flushed.
154 glFlush();
155 } 153 }
156 154
157 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture, 155 void MailboxSynchronizer::UpdateTextureLocked(Texture* texture,
158 TextureVersion& texture_version) { 156 TextureVersion& texture_version) {
159 lock_.AssertAcquired(); 157 lock_.AssertAcquired();
160 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0); 158 gfx::GLImage* gl_image = texture->GetLevelImage(texture->target(), 0);
161 TextureGroup* group = texture_version.group.get(); 159 TextureGroup* group = texture_version.group.get();
162 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image(); 160 scoped_refptr<NativeImageBuffer> image_buffer = group->definition.image();
163 161
164 // Make sure we don't clobber with an older version 162 // Make sure we don't clobber with an older version
(...skipping 30 matching lines...) Expand all
195 definition.IsOlderThan(it->second.version)) 193 definition.IsOlderThan(it->second.version))
196 continue; 194 continue;
197 it->second.version = definition.version(); 195 it->second.version = definition.version();
198 definition.UpdateTexture(texture); 196 definition.UpdateTexture(texture);
199 } 197 }
200 } 198 }
201 } 199 }
202 200
203 } // namespace gles2 201 } // namespace gles2
204 } // namespace gpu 202 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_definition.cc » ('j') | ui/gl/gl_context.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698