Handle account removal correctly on all platforms.
[chromium-blink-merge.git] / gpu / command_buffer / service / async_pixel_transfer_delegate.cc
blob201026b21769aa87f548fceeba749ec4ade44812
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
7 namespace gpu {
9 AsyncMemoryParams::AsyncMemoryParams(scoped_refptr<Buffer> buffer,
10 uint32 data_offset,
11 uint32 data_size)
12 : buffer_(buffer), data_offset_(data_offset), data_size_(data_size) {
13 DCHECK(buffer_.get());
14 DCHECK(buffer_->memory());
17 AsyncMemoryParams::~AsyncMemoryParams() {
20 AsyncPixelTransferUploadStats::AsyncPixelTransferUploadStats()
21 : texture_upload_count_(0) {}
23 AsyncPixelTransferUploadStats::~AsyncPixelTransferUploadStats() {}
25 void AsyncPixelTransferUploadStats::AddUpload(base::TimeDelta transfer_time) {
26 base::AutoLock scoped_lock(lock_);
27 texture_upload_count_++;
28 total_texture_upload_time_ += transfer_time;
31 int AsyncPixelTransferUploadStats::GetStats(
32 base::TimeDelta* total_texture_upload_time) {
33 base::AutoLock scoped_lock(lock_);
34 if (total_texture_upload_time)
35 *total_texture_upload_time = total_texture_upload_time_;
36 return texture_upload_count_;
39 AsyncPixelTransferDelegate::AsyncPixelTransferDelegate() {}
41 AsyncPixelTransferDelegate::~AsyncPixelTransferDelegate() {}
43 } // namespace gpu