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

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

Issue 11428140: gpu: Add async pixel transfer interface, stub and tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move BindFinishedTransfers to MakeCurrent. Rebase again. Created 8 years 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
OLDNEW
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 "gpu/command_buffer/service/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 #include "base/bits.h" 6 #include "base/bits.h"
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 8 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
9 #include "gpu/command_buffer/service/feature_info.h" 9 #include "gpu/command_buffer/service/feature_info.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 } 1203 }
1204 1204
1205 void TextureManager::AddToSignature( 1205 void TextureManager::AddToSignature(
1206 TextureInfo* info, 1206 TextureInfo* info,
1207 GLenum target, 1207 GLenum target,
1208 GLint level, 1208 GLint level,
1209 std::string* signature) const { 1209 std::string* signature) const {
1210 info->AddToSignature(feature_info_.get(), target, level, signature); 1210 info->AddToSignature(feature_info_.get(), target, level, signature);
1211 } 1211 }
1212 1212
1213 void TextureManager::AddPendingAsyncPixelTransfer(
1214 base::WeakPtr<gfx::AsyncPixelTransferState> state, TextureInfo* info) {
1215 pending_async_transfers_.push_back(PendingAsyncTransfer(state,info));
1216 }
1217
1218 void TextureManager::BindFinishedAsyncPixelTransfers(
1219 bool* texture_dirty, bool* framebuffer_dirty) {
1220 DCHECK(texture_dirty);
1221 DCHECK(framebuffer_dirty);
1222 *texture_dirty = false;
1223 *framebuffer_dirty = false;
1224
1225 // Remove finished transfers from the list, while
1226 // marking whether the texture unit or frame_buffer is dirty.
1227 for (PendingAsyncTransferList::iterator it = pending_async_transfers_.begin();
1228 it != pending_async_transfers_.end(); ) {
1229 // The AsyncState is owned by the TextureInfo. So if the
1230 // async state is deleted, so is the TextureInfo.
1231 if (!it->first.get()) {
1232 pending_async_transfers_.erase(it++);
greggman 2012/12/15 06:45:04 I still believe this needs to be it = pending_
epenner 2012/12/17 06:29:18 I realized I could use front()/pop_front() in this
1233 continue;
1234 }
1235 // Terminate early, as transfers finish in order.
1236 if (it->first->TransferIsInProgress())
1237 break;
1238 // If the transfer is finished, bind it to the texture,
1239 // and update the TextureInfo.
1240 *texture_dirty = true;
1241 *framebuffer_dirty |= it->second->IsAttachedToFramebuffer();
1242 gfx::AsyncTexImage2DParams tex_define_params;
1243 it->second->GetAsyncTransferState()->BindTransfer(&tex_define_params);
1244 SetLevelInfo(
1245 it->second,
1246 tex_define_params.target,
1247 tex_define_params.level,
1248 tex_define_params.internal_format,
1249 tex_define_params.width,
1250 tex_define_params.height,
1251 1, // depth
1252 tex_define_params.border,
1253 tex_define_params.format,
1254 tex_define_params.type,
1255 true); // cleared
1256 pending_async_transfers_.erase(it++);
greggman 2012/12/15 06:45:04 I still believe this needs to be it = pending_
epenner 2012/12/17 06:29:18 Ditto
1257 }
1258 }
1259
1213 } // namespace gles2 1260 } // namespace gles2
1214 } // namespace gpu 1261 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698