@@ -697,13 +697,18 @@ pub struct VBOId(gl::GLuint);
697
697
#[ derive( PartialEq , Eq , Hash , Debug , Copy , Clone ) ]
698
698
struct IBOId ( gl:: GLuint ) ;
699
699
700
+ #[ cfg( not( any( target_os = "android" , target_os = "gonk" ) ) ) ]
700
701
pub struct GpuProfile {
701
702
active_query : usize ,
702
703
gl_queries : Vec < gl:: GLuint > ,
703
704
first_frame : bool ,
704
705
}
705
706
707
+ #[ cfg( any( target_os = "android" , target_os = "gonk" ) ) ]
708
+ pub struct GpuProfile ;
709
+
706
710
impl GpuProfile {
711
+ #[ cfg( not( any( target_os = "android" , target_os = "gonk" ) ) ) ]
707
712
pub fn new ( ) -> GpuProfile {
708
713
let queries = gl:: gen_queries ( 4 ) ;
709
714
@@ -714,11 +719,21 @@ impl GpuProfile {
714
719
}
715
720
}
716
721
722
+ #[ cfg( any( target_os = "android" , target_os = "gonk" ) ) ]
723
+ pub fn new ( ) -> GpuProfile {
724
+ GpuProfile
725
+ }
726
+
727
+ #[ cfg( not( any( target_os = "android" , target_os = "gonk" ) ) ) ]
717
728
pub fn begin ( & mut self ) {
718
729
let qid = self . gl_queries [ self . active_query ] ;
719
730
gl:: begin_query ( gl:: TIME_ELAPSED , qid) ;
720
731
}
721
732
733
+ #[ cfg( any( target_os = "android" , target_os = "gonk" ) ) ]
734
+ pub fn begin ( & mut self ) { }
735
+
736
+ #[ cfg( not( any( target_os = "android" , target_os = "gonk" ) ) ) ]
722
737
pub fn end ( & mut self ) -> u64 {
723
738
gl:: end_query ( gl:: TIME_ELAPSED ) ;
724
739
@@ -745,6 +760,9 @@ impl GpuProfile {
745
760
0
746
761
}
747
762
}
763
+
764
+ #[ cfg( any( target_os = "android" , target_os = "gonk" ) ) ]
765
+ pub fn end ( & mut self ) -> u64 { 0 }
748
766
}
749
767
750
768
impl Drop for GpuProfile {
0 commit comments