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

Side by Side Diff: ui/gl/async_pixel_transfer_delegate_android.cc

Issue 12040049: gpu: Implement idle async pixel transfers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove texture_dirty_ state from AsyncPixelTransferDelegateIdle Created 7 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 (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 "ui/gl/async_pixel_transfer_delegate_android.h" 5 #include "ui/gl/async_pixel_transfer_delegate_android.h"
6 6
7 #include <list> 7 #include <list>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 const AsyncMemoryParams& mem_params, 377 const AsyncMemoryParams& mem_params,
378 const base::Closure& bind_callback) OVERRIDE; 378 const base::Closure& bind_callback) OVERRIDE;
379 virtual void AsyncTexSubImage2D( 379 virtual void AsyncTexSubImage2D(
380 AsyncPixelTransferState* state, 380 AsyncPixelTransferState* state,
381 const AsyncTexSubImage2DParams& tex_params, 381 const AsyncTexSubImage2DParams& tex_params,
382 const AsyncMemoryParams& mem_params) OVERRIDE; 382 const AsyncMemoryParams& mem_params) OVERRIDE;
383 virtual void WaitForTransferCompletion( 383 virtual void WaitForTransferCompletion(
384 AsyncPixelTransferState* state) OVERRIDE; 384 AsyncPixelTransferState* state) OVERRIDE;
385 virtual uint32 GetTextureUploadCount() OVERRIDE; 385 virtual uint32 GetTextureUploadCount() OVERRIDE;
386 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; 386 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE;
387 virtual bool ProcessMorePendingTransfers() OVERRIDE;
388 virtual bool NeedsProcessMorePendingTransfers() OVERRIDE;
387 389
388 private: 390 private:
389 // implement AsyncPixelTransferDelegate: 391 // implement AsyncPixelTransferDelegate:
390 virtual AsyncPixelTransferState* 392 virtual AsyncPixelTransferState*
391 CreateRawPixelTransferState(GLuint texture_id, 393 CreateRawPixelTransferState(GLuint texture_id,
392 const AsyncTexImage2DParams& define_params) OVERRIDE; 394 const AsyncTexImage2DParams& define_params) OVERRIDE;
393 395
394 static void PerformNotifyCompletion( 396 static void PerformNotifyCompletion(
395 AsyncMemoryParams mem_params, 397 AsyncMemoryParams mem_params,
396 ScopedSafeSharedMemory* safe_shared_memory, 398 ScopedSafeSharedMemory* safe_shared_memory,
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 return texture_upload_stats_->GetStats(NULL); 653 return texture_upload_stats_->GetStats(NULL);
652 } 654 }
653 655
654 base::TimeDelta AsyncPixelTransferDelegateAndroid::GetTotalTextureUploadTime() { 656 base::TimeDelta AsyncPixelTransferDelegateAndroid::GetTotalTextureUploadTime() {
655 CHECK(texture_upload_stats_); 657 CHECK(texture_upload_stats_);
656 base::TimeDelta total_texture_upload_time; 658 base::TimeDelta total_texture_upload_time;
657 texture_upload_stats_->GetStats(&total_texture_upload_time); 659 texture_upload_stats_->GetStats(&total_texture_upload_time);
658 return total_texture_upload_time; 660 return total_texture_upload_time;
659 } 661 }
660 662
663 bool AsyncPixelTransferDelegateAndroid::ProcessMorePendingTransfers() {
664 return false;
665 }
666
667 bool AsyncPixelTransferDelegateAndroid::NeedsProcessMorePendingTransfers() {
668 return false;
669 }
670
671
661 namespace { 672 namespace {
662 void SetGlParametersForEglImageTexture() { 673 void SetGlParametersForEglImageTexture() {
663 // These params are needed for EGLImage creation to succeed on several 674 // These params are needed for EGLImage creation to succeed on several
664 // Android devices. I couldn't find this requirement in the EGLImage 675 // Android devices. I couldn't find this requirement in the EGLImage
665 // extension spec, but several devices fail without it. 676 // extension spec, but several devices fail without it.
666 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 677 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
667 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 678 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
668 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 679 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
669 } 680 }
670 } // namespace 681 } // namespace
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 if (texture_upload_stats_) { 899 if (texture_upload_stats_) {
889 texture_upload_stats_->AddUpload( 900 texture_upload_stats_->AddUpload(
890 base::TimeTicks::HighResNow() - begin_time); 901 base::TimeTicks::HighResNow() - begin_time);
891 } 902 }
892 903
893 DCHECK(CHECK_GL()); 904 DCHECK(CHECK_GL());
894 return true; 905 return true;
895 } 906 }
896 907
897 } // namespace gfx 908 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698