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

Unified Diff: gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc

Issue 793693003: Tile Compression (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
diff --git a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
index 4bc2ba20ea014f1bf918bf94eec1f8329e27d89d..b231f2f44d840094b43bb588bccda07b028e6f09 100644
--- a/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
+++ b/gpu/command_buffer/service/async_pixel_transfer_manager_sync.cc
@@ -21,6 +21,13 @@ class AsyncPixelTransferDelegateSync : public AsyncPixelTransferDelegate {
const base::Closure& bind_callback) override;
void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params,
const AsyncMemoryParams& mem_params) override;
+ void AsyncCompressedTexImage2D(
+ const AsyncCompressedTexImage2DParams& tex_params,
+ const AsyncMemoryParams& mem_params,
+ const base::Closure& bind_callback) override;
+ void AsyncCompressedTexSubImage2D(
+ const AsyncCompressedTexSubImage2DParams& tex_params,
+ const AsyncMemoryParams& mem_params) override;
bool TransferIsInProgress() override;
void WaitForTransferCompletion() override;
@@ -83,6 +90,39 @@ void AsyncPixelTransferDelegateSync::AsyncTexSubImage2D(
base::TimeTicks::HighResNow() - begin_time;
}
+void AsyncPixelTransferDelegateSync::AsyncCompressedTexImage2D(
+ const AsyncCompressedTexImage2DParams& tex_params,
+ const AsyncMemoryParams& mem_params,
+ const base::Closure& bind_callback) {
+ // Save the define params to return later during deferred
+ // binding of the transfer texture.
+ void* data = mem_params.GetDataAddress();
+ base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ glCompressedTexImage2D(tex_params.target, tex_params.level,
+ tex_params.internal_format, tex_params.width,
+ tex_params.height, tex_params.border,
+ tex_params.image_size, data);
+ shared_state_->texture_upload_count++;
+ shared_state_->total_texture_upload_time +=
+ base::TimeTicks::HighResNow() - begin_time;
+ // The texture is already fully bound so just call it now.
+ bind_callback.Run();
+}
+
+void AsyncPixelTransferDelegateSync::AsyncCompressedTexSubImage2D(
+ const AsyncCompressedTexSubImage2DParams& tex_params,
+ const AsyncMemoryParams& mem_params) {
+ void* data = mem_params.GetDataAddress();
+ base::TimeTicks begin_time(base::TimeTicks::HighResNow());
+ glCompressedTexSubImage2D(tex_params.target, tex_params.level,
+ tex_params.xoffset, tex_params.yoffset,
+ tex_params.width, tex_params.height,
+ tex_params.format, tex_params.image_size, data);
+ shared_state_->texture_upload_count++;
+ shared_state_->total_texture_upload_time +=
+ base::TimeTicks::HighResNow() - begin_time;
+}
+
bool AsyncPixelTransferDelegateSync::TransferIsInProgress() {
// Already done.
return false;
@@ -136,4 +176,11 @@ AsyncPixelTransferManagerSync::CreatePixelTransferDelegateImpl(
return new AsyncPixelTransferDelegateSync(&shared_state_);
}
+AsyncPixelTransferDelegate*
+AsyncPixelTransferManagerSync::CreatePixelTransferDelegateImpl(
+ gles2::TextureRef* ref,
+ const AsyncCompressedTexImage2DParams& define_params) {
+ return new AsyncPixelTransferDelegateSync(&shared_state_);
+}
+
} // namespace gpu
« no previous file with comments | « gpu/command_buffer/service/async_pixel_transfer_manager_sync.h ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698