From d4ab46dda11196914feb87d448fa92dfde712ebc Mon Sep 17 00:00:00 2001 From: uzair Date: Mon, 28 Nov 2022 16:15:21 +0530 Subject: [PATCH] Use skia gl backend texture to draw on evasgl surface On browser side evasgl expects gl texture for drawing the final composited webview onto the evasgl surface, hence below change gets the gl texture from skia and forwards the same to browser side. References: https://review.tizen.org/gerrit/c/263250 https://review.tizen.org/gerrit/c/270830 Change-Id: Id3481672fee751934929295c0f34ed8bda5beefd Signed-off-by: uzair --- components/viz/host/host_frame_sink_client.h | 3 +++ components/viz/host/host_frame_sink_manager.cc | 12 ++++++++++++ components/viz/host/host_frame_sink_manager.h | 5 +++++ components/viz/service/display/display.cc | 6 ++++++ components/viz/service/display/display.h | 4 +++- components/viz/service/display/display_client.h | 3 +++ components/viz/service/display/output_surface_client.h | 4 ++++ .../viz/service/display_embedder/skia_output_device.cc | 7 +++++++ components/viz/service/display_embedder/skia_output_device.h | 3 +++ .../service/display_embedder/skia_output_device_offscreen.cc | 9 +++++++++ .../service/display_embedder/skia_output_device_offscreen.h | 3 +++ .../viz/service/display_embedder/skia_output_surface_impl.cc | 11 +++++++++++ .../display_embedder/skia_output_surface_impl_on_gpu.cc | 8 ++++++++ .../display_embedder/skia_output_surface_impl_on_gpu.h | 4 +++- .../viz/service/frame_sinks/frame_sink_manager_impl.cc | 8 ++++++++ components/viz/service/frame_sinks/frame_sink_manager_impl.h | 4 ++++ .../service/frame_sinks/root_compositor_frame_sink_impl.cc | 7 +++++++ .../service/frame_sinks/root_compositor_frame_sink_impl.h | 4 ++++ content/browser/renderer_host/delegated_frame_host.cc | 6 ++++++ content/browser/renderer_host/delegated_frame_host.h | 7 +++++++ .../renderer_host/delegated_frame_host_client_aura.cc | 6 ++++++ .../browser/renderer_host/delegated_frame_host_client_aura.h | 3 +++ .../browser/renderer_host/render_widget_host_view_aura.cc | 7 +++++++ content/browser/renderer_host/render_widget_host_view_aura.h | 1 + services/viz/privileged/mojom/compositing/BUILD.gn | 3 +++ .../privileged/mojom/compositing/frame_sink_manager.mojom | 3 +++ .../browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc | 12 ++++++------ 27 files changed, 145 insertions(+), 8 deletions(-) diff --git a/components/viz/host/host_frame_sink_client.h b/components/viz/host/host_frame_sink_client.h index 288cf89..60f7ce8 100644 --- a/components/viz/host/host_frame_sink_client.h +++ b/components/viz/host/host_frame_sink_client.h @@ -22,6 +22,9 @@ class HostFrameSinkClient { // Called when a CompositorFrame with a new frame token is provided. virtual void OnFrameTokenChanged(uint32_t frame_token, base::TimeTicks activation_time) = 0; +#if defined(USE_EFL) + virtual void NotifySwap(const uint32_t texture_id) {} +#endif protected: virtual ~HostFrameSinkClient() {} diff --git a/components/viz/host/host_frame_sink_manager.cc b/components/viz/host/host_frame_sink_manager.cc index 8d724ed..207728b 100644 --- a/components/viz/host/host_frame_sink_manager.cc +++ b/components/viz/host/host_frame_sink_manager.cc @@ -441,4 +441,16 @@ HostFrameSinkManager::FrameSinkData::~FrameSinkData() = default; HostFrameSinkManager::FrameSinkData& HostFrameSinkManager::FrameSinkData:: operator=(FrameSinkData&& other) = default; +#if defined(USE_EFL) +void HostFrameSinkManager::NotifySwap(const uint32_t texture_id, + const FrameSinkId& frame_sink_id) { + auto iter = frame_sink_data_map_.find(frame_sink_id); + if (iter != frame_sink_data_map_.end()) { + const FrameSinkData& data = iter->second; + if (data.client) + data.client->NotifySwap(texture_id); + } +} +#endif + } // namespace viz diff --git a/components/viz/host/host_frame_sink_manager.h b/components/viz/host/host_frame_sink_manager.h index 0c8c1a6..2965efb 100644 --- a/components/viz/host/host_frame_sink_manager.h +++ b/components/viz/host/host_frame_sink_manager.h @@ -295,6 +295,11 @@ class VIZ_HOST_EXPORT HostFrameSinkManager const bool enable_sync_window_destruction_; +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id, + const FrameSinkId& frame_sink_id) override; +#endif + // Connections to/from FrameSinkManagerImpl. mojo::Remote frame_sink_manager_remote_; // This will point to |frame_sink_manager_remote_| if using mojo or it may diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index 78b1da4..f7d64d5 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc @@ -1416,4 +1416,10 @@ void Display::InitDelegatedInkPointRendererReceiver( } } +#if defined(USE_EFL) +void Display::NotifySwap(const uint32_t texture_id) { + client_->NotifySwap(texture_id); +} +#endif + } // namespace viz diff --git a/components/viz/service/display/display.h b/components/viz/service/display/display.h index 18a9fea..ec3c8ef 100644 --- a/components/viz/service/display/display.h +++ b/components/viz/service/display/display.h @@ -167,7 +167,9 @@ class VIZ_SERVICE_EXPORT Display : public DisplaySchedulerClient, const gfx::PresentationFeedback& feedback) override; void DidReceiveReleasedOverlays( const std::vector& released_overlays) override; - +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id) override; +#endif // LatestLocalSurfaceIdLookupDelegate implementation. LocalSurfaceId GetSurfaceAtAggregation( const FrameSinkId& frame_sink_id) const override; diff --git a/components/viz/service/display/display_client.h b/components/viz/service/display/display_client.h index f114619..cd013f4 100644 --- a/components/viz/service/display/display_client.h +++ b/components/viz/service/display/display_client.h @@ -33,6 +33,9 @@ class DisplayClient { virtual base::TimeDelta GetPreferredFrameIntervalForFrameSinkId( const FrameSinkId& id, mojom::CompositorFrameSinkType* type) = 0; +#if defined(USE_EFL) + virtual void NotifySwap(const uint32_t texture_id) {} +#endif }; } // namespace viz diff --git a/components/viz/service/display/output_surface_client.h b/components/viz/service/display/output_surface_client.h index aaa8fd0..2a628bd 100644 --- a/components/viz/service/display/output_surface_client.h +++ b/components/viz/service/display/output_surface_client.h @@ -53,6 +53,10 @@ class VIZ_SERVICE_EXPORT OutputSurfaceClient { virtual void DidReceiveReleasedOverlays( const std::vector& released_overlays) = 0; +#if defined(USE_EFL) + virtual void NotifySwap(const uint32_t texture_id) {} +#endif + protected: virtual ~OutputSurfaceClient() {} }; diff --git a/components/viz/service/display_embedder/skia_output_device.cc b/components/viz/service/display_embedder/skia_output_device.cc index 497396e..fd6c4a1 100644 --- a/components/viz/service/display_embedder/skia_output_device.cc +++ b/components/viz/service/display_embedder/skia_output_device.cc @@ -154,6 +154,13 @@ void SkiaOutputDevice::PostSubBuffer(const gfx::Rect& rect, NOTREACHED(); } +#if defined(USE_EFL) +uint32_t SkiaOutputDevice::GetTextureID() { + NOTREACHED(); + return 0; +} +#endif + bool SkiaOutputDevice::EnsureMinNumberOfBuffers(size_t n) { NOTREACHED(); return false; diff --git a/components/viz/service/display_embedder/skia_output_device.h b/components/viz/service/display_embedder/skia_output_device.h index 94fe153..acb6632 100644 --- a/components/viz/service/display_embedder/skia_output_device.h +++ b/components/viz/service/display_embedder/skia_output_device.h @@ -131,6 +131,9 @@ class SkiaOutputDevice { virtual void PostSubBuffer(const gfx::Rect& rect, BufferPresentedCallback feedback, OutputSurfaceFrame frame); +#if defined(USE_EFL) + virtual uint32_t GetTextureID(); +#endif virtual void CommitOverlayPlanes(BufferPresentedCallback feedback, OutputSurfaceFrame frame); virtual bool EnsureMinNumberOfBuffers(size_t n); diff --git a/components/viz/service/display_embedder/skia_output_device_offscreen.cc b/components/viz/service/display_embedder/skia_output_device_offscreen.cc index 54c1d57..7762ed8 100644 --- a/components/viz/service/display_embedder/skia_output_device_offscreen.cc +++ b/components/viz/service/display_embedder/skia_output_device_offscreen.cc @@ -146,4 +146,13 @@ SkSurface* SkiaOutputDeviceOffscreen::BeginPaint( void SkiaOutputDeviceOffscreen::EndPaint() {} +#if defined(USE_EFL) +uint32_t SkiaOutputDeviceOffscreen::GetTextureID() { + GrGLTextureInfo info; + if (!backend_texture_.getGLTextureInfo(&info)) + return 0; + return info.fID; +} +#endif + } // namespace viz diff --git a/components/viz/service/display_embedder/skia_output_device_offscreen.h b/components/viz/service/display_embedder/skia_output_device_offscreen.h index ca4ae4a..4301468 100644 --- a/components/viz/service/display_embedder/skia_output_device_offscreen.h +++ b/components/viz/service/display_embedder/skia_output_device_offscreen.h @@ -44,6 +44,9 @@ class SkiaOutputDeviceOffscreen : public SkiaOutputDevice { SkSurface* BeginPaint( std::vector* end_semaphores) override; void EndPaint() override; +#if defined(USE_EFL) + uint32_t GetTextureID() override; +#endif protected: scoped_refptr context_state_; diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.cc b/components/viz/service/display_embedder/skia_output_surface_impl.cc index e3834d7..748fa60 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl.cc @@ -61,6 +61,11 @@ #include "components/viz/service/display/dc_layer_overlay.h" #endif +#if defined(USE_EFL) +#include "base/base_switches.h" +#include "base/command_line.h" +#endif + namespace viz { namespace { @@ -1024,6 +1029,12 @@ void SkiaOutputSurfaceImpl::DidSwapBuffersComplete( client_->DidReceiveReleasedOverlays(params.released_overlays); if (needs_swap_size_notifications_) client_->DidSwapWithSize(pixel_size); +#if defined(USE_EFL) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableOffscreenRendering)) { + client_->NotifySwap(impl_on_gpu_->GetTextureID()); + } +#endif } void SkiaOutputSurfaceImpl::BufferPresented( diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc index 48b2de3..b933537 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.cc @@ -2308,6 +2308,14 @@ void SkiaOutputSurfaceImplOnGpu::DestroySharedImage(gpu::Mailbox mailbox) { solid_color_images_.erase(mailbox); } +#if defined(USE_EFL) +uint32_t SkiaOutputSurfaceImplOnGpu::GetTextureID() { + if (output_device_) + return output_device_->GetTextureID(); + return 0; +} +#endif + gpu::SkiaImageRepresentation* SkiaOutputSurfaceImplOnGpu::GetSkiaRepresentation( gpu::Mailbox mailbox) { auto it = skia_representations_.find(mailbox); diff --git a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h index 3c3e7a8..ebe8902 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h +++ b/components/viz/service/display_embedder/skia_output_surface_impl_on_gpu.h @@ -262,7 +262,9 @@ class SkiaOutputSurfaceImplOnGpu const SkColor4f& color, const gfx::ColorSpace& color_space); void DestroySharedImage(gpu::Mailbox mailbox); - +#if defined(USE_EFL) + uint32_t GetTextureID(); +#endif private: struct PlaneAccessData { PlaneAccessData(); diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc index 7c25edc..e876127 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc @@ -808,4 +808,12 @@ void FrameSinkManagerImpl::ClearThrottling(const FrameSinkId& id) { UpdateThrottlingRecursively(id, base::TimeDelta()); } +#if defined(USE_EFL) +void FrameSinkManagerImpl::NotifySwap(const uint32_t texture_id, + const FrameSinkId& id) { + for (auto child : GetChildrenByParent(id)) + client_->NotifySwap(texture_id, child); +} +#endif + } // namespace viz diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h index aae01af..cd742b3 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h @@ -257,6 +257,10 @@ class VIZ_SERVICE_EXPORT FrameSinkManagerImpl bool VerifySandboxedThreadIds( base::flat_set thread_ids); +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id, const FrameSinkId& id); +#endif + private: friend class FrameSinkManagerTest; diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc index dc270ca..5fc4c1b 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc @@ -623,4 +623,11 @@ BeginFrameSource* RootCompositorFrameSinkImpl::begin_frame_source() { return synthetic_begin_frame_source_.get(); } +#if defined(USE_EFL) +void RootCompositorFrameSinkImpl::NotifySwap(const uint32_t texture_id) { + support_->frame_sink_manager()->NotifySwap(texture_id, + support_->frame_sink_id()); +} +#endif + } // namespace viz diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h index eefff2f..ae9a690 100644 --- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h +++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h @@ -122,6 +122,10 @@ class VIZ_SERVICE_EXPORT RootCompositorFrameSinkImpl base::ScopedClosureRunner GetCacheBackBufferCb(); +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id) override; +#endif + private: class StandaloneBeginFrameObserver; diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index b089659..812557b 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc @@ -329,6 +329,12 @@ void DelegatedFrameHost::OnFrameTokenChanged(uint32_t frame_token, client_->OnFrameTokenChanged(frame_token, activation_time); } +#if defined(USE_EFL) +void DelegatedFrameHost::NotifySwap(const uint32_t texture_id) { + client_->NotifySwap(texture_id); +} +#endif + // CommitPending without a target for TakeFallbackContentFrom. Since we cannot // guarantee that Navigation will complete, evict our surfaces which are from // a previous Navigation. diff --git a/content/browser/renderer_host/delegated_frame_host.h b/content/browser/renderer_host/delegated_frame_host.h index 7d55757..84e26e7 100644 --- a/content/browser/renderer_host/delegated_frame_host.h +++ b/content/browser/renderer_host/delegated_frame_host.h @@ -54,6 +54,9 @@ class CONTENT_EXPORT DelegatedFrameHostClient { virtual void InvalidateLocalSurfaceIdOnEviction() = 0; virtual std::vector CollectSurfaceIdsForEviction() = 0; virtual bool ShouldShowStaleContentOnEviction() = 0; +#if defined(USE_EFL) + virtual void NotifySwap(const uint32_t texture_id) {} +#endif }; // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state @@ -105,6 +108,10 @@ class CONTENT_EXPORT DelegatedFrameHost void OnFrameTokenChanged(uint32_t frame_token, base::TimeTicks activation_time) override; +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id) override; +#endif + // Public interface exposed to RenderWidgetHostView. // kOccluded means the native window for the host was diff --git a/content/browser/renderer_host/delegated_frame_host_client_aura.cc b/content/browser/renderer_host/delegated_frame_host_client_aura.cc index 6e1b082..e8cc565 100644 --- a/content/browser/renderer_host/delegated_frame_host_client_aura.cc +++ b/content/browser/renderer_host/delegated_frame_host_client_aura.cc @@ -64,4 +64,10 @@ bool DelegatedFrameHostClientAura::ShouldShowStaleContentOnEviction() { return render_widget_host_view_->ShouldShowStaleContentOnEviction(); } +#if defined(USE_EFL) +void DelegatedFrameHostClientAura::NotifySwap(const uint32_t texture_id) { + render_widget_host_view_->NotifySwap(texture_id); +} +#endif + } // namespace content diff --git a/content/browser/renderer_host/delegated_frame_host_client_aura.h b/content/browser/renderer_host/delegated_frame_host_client_aura.h index 87a23e8..40df7d1 100644 --- a/content/browser/renderer_host/delegated_frame_host_client_aura.h +++ b/content/browser/renderer_host/delegated_frame_host_client_aura.h @@ -42,6 +42,9 @@ class CONTENT_EXPORT DelegatedFrameHostClientAura void InvalidateLocalSurfaceIdOnEviction() override; std::vector CollectSurfaceIdsForEviction() override; bool ShouldShowStaleContentOnEviction() override; +#if defined(USE_EFL) + void NotifySwap(const uint32_t texture_id) override; +#endif private: raw_ptr render_widget_host_view_; diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 14d5617..9689808 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -547,6 +547,13 @@ bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() { return delegated_frame_host_->CanCopyFromCompositingSurface(); } +#if defined(USE_EFL) +void RenderWidgetHostViewAura::NotifySwap(const uint32_t texture_id) { + if (offscreen_helper_) + offscreen_helper_->NotifySwap(texture_id); +} +#endif + void RenderWidgetHostViewAura::EnsureSurfaceSynchronizedForWebTest() { ++latest_capture_sequence_number_; SynchronizeVisualProperties(cc::DeadlinePolicy::UseInfiniteDeadline(), diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 776aac9..93b10eb 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h @@ -409,6 +409,7 @@ class CONTENT_EXPORT RenderWidgetHostViewAura RWHVAuraOffscreenHelperEfl* offscreen_helper() { return offscreen_helper_.get(); } + void NotifySwap(const uint32_t texture_id); #endif protected: diff --git a/services/viz/privileged/mojom/compositing/BUILD.gn b/services/viz/privileged/mojom/compositing/BUILD.gn index f08214c..8a28eee 100644 --- a/services/viz/privileged/mojom/compositing/BUILD.gn +++ b/services/viz/privileged/mojom/compositing/BUILD.gn @@ -43,6 +43,9 @@ mojom("compositing") { if (enable_cast_overlay_strategy) { enabled_features += [ "enable_cast_overlay_strategy" ] } + if (use_efl) { + enabled_features += [ "use_efl" ] + } cpp_typemaps = [ { diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom index 5776b0b..2ac593f 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom @@ -192,4 +192,7 @@ interface FrameSinkManagerClient { // when a surface of the provided |frame_sink_id| activates. OnFrameTokenChanged(FrameSinkId frame_sink_id, uint32 frame_token, mojo_base.mojom.TimeTicks activation_time); + + [EnableIf=use_efl] + NotifySwap(uint32 texture_id, FrameSinkId frame_sink_id); }; diff --git a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc index efedfa5..e1d77ab 100644 --- a/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc +++ b/tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_offscreen_helper_efl.cc @@ -214,8 +214,8 @@ void RWHVAuraOffscreenHelperEfl::InitializeProgram() { // GL_CHECK_STATUS("fragment shader"); const GLfloat vertex_attributes[] = { - -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f}; + -1.0f, -1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 0.0f, 0.0f}; evas_gl_api_->glGenBuffers(1, &vertex_buffer_obj_); evas_gl_api_->glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_obj_); @@ -285,13 +285,13 @@ void RWHVAuraOffscreenHelperEfl::PaintTextureToSurface(GLuint texture_id) { evas_gl_api_->glBindTexture(GL_TEXTURE_2D, texture_id); evas_gl_api_->glUniform1i(source_texture_location_, 0); if (rotation_ == 0) { - evas_gl_api_->glUniform2f(rotate_position_attrib_, 0, 1); + evas_gl_api_->glUniform2f(rotate_position_attrib_, 0, -1); } else if (rotation_ == 90) { - evas_gl_api_->glUniform2f(rotate_position_attrib_, -1, 0); + evas_gl_api_->glUniform2f(rotate_position_attrib_, 1, 0); } else if (rotation_ == 180) { - evas_gl_api_->glUniform2f(rotate_position_attrib_, 0, -1); + evas_gl_api_->glUniform2f(rotate_position_attrib_, 0, 1); } else if (rotation_ == 270) { - evas_gl_api_->glUniform2f(rotate_position_attrib_, 1, 0); + evas_gl_api_->glUniform2f(rotate_position_attrib_, -1, 0); } evas_gl_api_->glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL); -- 2.7.4