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 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 WGC3Denum target, | 622 WGC3Denum target, |
623 WGC3Dint level, | 623 WGC3Dint level, |
624 WGC3Dint xoffset, | 624 WGC3Dint xoffset, |
625 WGC3Dint yoffset, | 625 WGC3Dint yoffset, |
626 WGC3Dsizei width, | 626 WGC3Dsizei width, |
627 WGC3Dsizei height, | 627 WGC3Dsizei height, |
628 WGC3Denum format, | 628 WGC3Denum format, |
629 WGC3Denum type, | 629 WGC3Denum type, |
630 const void* pixels); | 630 const void* pixels); |
631 | 631 |
| 632 virtual void setLatencyInfoCHROMIUM( |
| 633 const WebKit::WebLatencyInfo& latencyInfo); |
| 634 virtual void setLatencyInfoCallbackCHROMIUM( |
| 635 WebGraphicsLatencyInfoCallbackCHROMIUM* callback); |
632 protected: | 636 protected: |
633 virtual GrGLInterface* onCreateGrGLInterface(); | 637 virtual GrGLInterface* onCreateGrGLInterface(); |
634 | 638 |
635 private: | 639 private: |
636 // These are the same error codes as used by EGL. | 640 // These are the same error codes as used by EGL. |
637 enum Error { | 641 enum Error { |
638 SUCCESS = 0x3000, | 642 SUCCESS = 0x3000, |
639 BAD_ATTRIBUTE = 0x3004, | 643 BAD_ATTRIBUTE = 0x3004, |
640 CONTEXT_LOST = 0x300E | 644 CONTEXT_LOST = 0x300E |
641 }; | 645 }; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 701 |
698 // Check if we should call into the swap client. We can only do that on the | 702 // Check if we should call into the swap client. We can only do that on the |
699 // main thread. | 703 // main thread. |
700 bool ShouldUseSwapClient(); | 704 bool ShouldUseSwapClient(); |
701 | 705 |
702 // MemoryAllocationChanged callback. | 706 // MemoryAllocationChanged callback. |
703 void OnMemoryAllocationChanged( | 707 void OnMemoryAllocationChanged( |
704 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback, | 708 WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback, |
705 const GpuMemoryAllocationForRenderer& allocation); | 709 const GpuMemoryAllocationForRenderer& allocation); |
706 | 710 |
| 711 void OnSetLatencyInfo(const WebKit::WebLatencyInfoImpl& latency_info); |
| 712 |
707 // Convert the gpu cutoff enum to the WebKit enum. | 713 // Convert the gpu cutoff enum to the WebKit enum. |
708 static WebGraphicsMemoryAllocation::PriorityCutoff WebkitPriorityCutoff( | 714 static WebGraphicsMemoryAllocation::PriorityCutoff WebkitPriorityCutoff( |
709 GpuMemoryAllocationForRenderer::PriorityCutoff priorityCutoff); | 715 GpuMemoryAllocationForRenderer::PriorityCutoff priorityCutoff); |
710 | 716 |
711 bool initialize_failed_; | 717 bool initialize_failed_; |
712 | 718 |
713 // The channel factory to talk to the GPU process | 719 // The channel factory to talk to the GPU process |
714 GpuChannelHostFactory* factory_; | 720 GpuChannelHostFactory* factory_; |
715 | 721 |
716 bool visible_; | 722 bool visible_; |
717 bool free_command_buffer_when_invisible_; | 723 bool free_command_buffer_when_invisible_; |
718 | 724 |
719 // State needed by MaybeInitializeGL. | 725 // State needed by MaybeInitializeGL. |
720 scoped_refptr<GpuChannelHost> host_; | 726 scoped_refptr<GpuChannelHost> host_; |
721 int32 surface_id_; | 727 int32 surface_id_; |
722 GURL active_url_; | 728 GURL active_url_; |
723 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client_; | 729 base::WeakPtr<WebGraphicsContext3DSwapBuffersClient> swap_client_; |
724 | 730 |
725 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; | 731 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; |
726 WGC3Denum context_lost_reason_; | 732 WGC3Denum context_lost_reason_; |
727 | 733 |
728 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* | 734 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* |
729 error_message_callback_; | 735 error_message_callback_; |
730 scoped_ptr<WebGraphicsContext3DErrorMessageCallback> | 736 scoped_ptr<WebGraphicsContext3DErrorMessageCallback> |
731 client_error_message_callback_; | 737 client_error_message_callback_; |
732 | 738 |
733 WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* | 739 WebGraphicsContext3D::WebGraphicsSwapBuffersCompleteCallbackCHROMIUM* |
734 swapbuffers_complete_callback_; | 740 swapbuffers_complete_callback_; |
735 | 741 |
| 742 WebGraphicsContext3D::WebGraphicsLatencyInfoCallbackCHROMIUM* |
| 743 latency_info_callback_; |
| 744 |
736 WebKit::WebGraphicsContext3D::Attributes attributes_; | 745 WebKit::WebGraphicsContext3D::Attributes attributes_; |
737 gfx::GpuPreference gpu_preference_; | 746 gfx::GpuPreference gpu_preference_; |
738 int cached_width_, cached_height_; | 747 int cached_width_, cached_height_; |
739 | 748 |
740 // For tracking which FBO is bound. | 749 // For tracking which FBO is bound. |
741 WebGLId bound_fbo_; | 750 WebGLId bound_fbo_; |
742 | 751 |
743 // Errors raised by synthesizeGLError(). | 752 // Errors raised by synthesizeGLError(). |
744 std::vector<WGC3Denum> synthetic_errors_; | 753 std::vector<WGC3Denum> synthetic_errors_; |
745 | 754 |
(...skipping 15 matching lines...) Expand all Loading... |
761 gpu::gles2::GLES2Implementation* gl_; | 770 gpu::gles2::GLES2Implementation* gl_; |
762 Error last_error_; | 771 Error last_error_; |
763 int frame_number_; | 772 int frame_number_; |
764 bool bind_generates_resources_; | 773 bool bind_generates_resources_; |
765 bool use_echo_for_swap_ack_; | 774 bool use_echo_for_swap_ack_; |
766 }; | 775 }; |
767 | 776 |
768 } // namespace content | 777 } // namespace content |
769 | 778 |
770 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 779 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |