| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 const AsyncTexImage2DParams& tex_params, | 365 const AsyncTexImage2DParams& tex_params, |
| 366 const AsyncMemoryParams& mem_params) OVERRIDE; | 366 const AsyncMemoryParams& mem_params) OVERRIDE; |
| 367 virtual void AsyncTexSubImage2D( | 367 virtual void AsyncTexSubImage2D( |
| 368 AsyncPixelTransferState* state, | 368 AsyncPixelTransferState* state, |
| 369 const AsyncTexSubImage2DParams& tex_params, | 369 const AsyncTexSubImage2DParams& tex_params, |
| 370 const AsyncMemoryParams& mem_params) OVERRIDE; | 370 const AsyncMemoryParams& mem_params) OVERRIDE; |
| 371 virtual void WaitForTransferCompletion( | 371 virtual void WaitForTransferCompletion( |
| 372 AsyncPixelTransferState* state) OVERRIDE; | 372 AsyncPixelTransferState* state) OVERRIDE; |
| 373 virtual uint32 GetTextureUploadCount() OVERRIDE; | 373 virtual uint32 GetTextureUploadCount() OVERRIDE; |
| 374 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; | 374 virtual base::TimeDelta GetTotalTextureUploadTime() OVERRIDE; |
| 375 virtual void ProcessPendingTransfers() OVERRIDE; |
| 376 virtual bool HasPendingTransfers() OVERRIDE; |
| 375 | 377 |
| 376 private: | 378 private: |
| 377 // implement AsyncPixelTransferDelegate: | 379 // implement AsyncPixelTransferDelegate: |
| 378 virtual AsyncPixelTransferState* | 380 virtual AsyncPixelTransferState* |
| 379 CreateRawPixelTransferState(GLuint texture_id) OVERRIDE; | 381 CreateRawPixelTransferState(GLuint texture_id) OVERRIDE; |
| 380 | 382 |
| 381 static void PerformNotifyCompletion( | 383 static void PerformNotifyCompletion( |
| 382 AsyncMemoryParams mem_params, | 384 AsyncMemoryParams mem_params, |
| 383 ScopedSafeSharedMemory* safe_shared_memory, | 385 ScopedSafeSharedMemory* safe_shared_memory, |
| 384 const CompletionCallback& callback); | 386 const CompletionCallback& callback); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 return texture_upload_stats_->GetStats(NULL); | 604 return texture_upload_stats_->GetStats(NULL); |
| 603 } | 605 } |
| 604 | 606 |
| 605 base::TimeDelta AsyncPixelTransferDelegateAndroid::GetTotalTextureUploadTime() { | 607 base::TimeDelta AsyncPixelTransferDelegateAndroid::GetTotalTextureUploadTime() { |
| 606 CHECK(texture_upload_stats_); | 608 CHECK(texture_upload_stats_); |
| 607 base::TimeDelta total_texture_upload_time; | 609 base::TimeDelta total_texture_upload_time; |
| 608 texture_upload_stats_->GetStats(&total_texture_upload_time); | 610 texture_upload_stats_->GetStats(&total_texture_upload_time); |
| 609 return total_texture_upload_time; | 611 return total_texture_upload_time; |
| 610 } | 612 } |
| 611 | 613 |
| 614 void AsyncPixelTransferDelegateAndroid::ProcessPendingTransfers() {} |
| 615 |
| 616 bool AsyncPixelTransferDelegateAndroid::HasPendingTransfers() { |
| 617 return false; |
| 618 } |
| 619 |
| 620 |
| 612 namespace { | 621 namespace { |
| 613 void SetGlParametersForEglImageTexture() { | 622 void SetGlParametersForEglImageTexture() { |
| 614 // These params are needed for EGLImage creation to succeed on several | 623 // These params are needed for EGLImage creation to succeed on several |
| 615 // Android devices. I couldn't find this requirement in the EGLImage | 624 // Android devices. I couldn't find this requirement in the EGLImage |
| 616 // extension spec, but several devices fail without it. | 625 // extension spec, but several devices fail without it. |
| 617 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 626 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 618 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 627 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 619 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 628 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 620 } | 629 } |
| 621 } // namespace | 630 } // namespace |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 if (texture_upload_stats_) { | 843 if (texture_upload_stats_) { |
| 835 texture_upload_stats_->AddUpload( | 844 texture_upload_stats_->AddUpload( |
| 836 base::TimeTicks::HighResNow() - begin_time); | 845 base::TimeTicks::HighResNow() - begin_time); |
| 837 } | 846 } |
| 838 | 847 |
| 839 DCHECK(CHECK_GL()); | 848 DCHECK(CHECK_GL()); |
| 840 return true; | 849 return true; |
| 841 } | 850 } |
| 842 | 851 |
| 843 } // namespace gfx | 852 } // namespace gfx |
| OLD | NEW |