WebPageTexture

Since: BlackBerry 10.0.0

#include <bb/cascades/WebPageTexture>

The texture that can be used as a render target when compositing the internal scene graph of a webpage.

A WebPageTexture can be used as a render target when compositing the internal scene graph of a WebPage using a WebPageCompositor. The texture can then be used in custom OpenGL rendering code to render the webpage as part of an OpenGL scene.

This object can be created on any thread. However, the object has an affinity for the thread it was created on, and may not be used on any other thread.

When calling the textureId() method on a WebPageTexture object, an OpenGL ES 2.0 capable EGL context must be current.


Overview

QML properties

size: QSize
textureId: quint32 [read-only]

Properties Index

QSizesize
quint32textureId [read-only]

Public Functions Index

WebPageTexture (const QSize &size, QObject *parent=0)
WebPageTexture ()
virtual ~WebPageTexture ()
QSizesize () const
quint32textureId () const

Public Slots Index

voidsetSize (const QSize &size)

Signals Index

voidsizeChanged (const QSize &newSize)
voidtextureChanged ()

Properties

QSize size

The size of the texture.

See also:

WebPageTexture::size().

Since:

BlackBerry 10.0.0

quint32 textureId[read-only]

The ID of an OpenGL texture.

Since:

BlackBerry 10.0.0

Public Functions

WebPageTexture (

Constructs a WebPageTexture object with the requested size.

Parameters
size

The requested size of the texture.

parent

Optional parent for this object.

Since:

BlackBerry 10.0.0

WebPageTexture ()

virtual~WebPageTexture ()

Destructor.

QSize size ()

Retrieves the texture size requested.

The actual size of the texture may not be equal to the requested size due to GPU limitations.

Return:

The size requested when constructing this WebPageTexture object.

Since:

BlackBerry 10.0.0

quint32 textureId ()

Retrieves the ID of an OpenGL texture in the EGL context that is current on the calling thread.

Note:

When calling this method, an OpenGL ES 2.0 capable EGL context must be current.

This method will return 0 if there is no texture yet, or if called from another thread than the thread that called WebPageCompositor::renderToTexture().
Initially, the texture will have the following properties:
  • GL_TEXTURE_MIN_FILTER: GL_LINEAR

  • GL_TEXTURE_MAG_FILTER: GL_LINEAR

  • GL_TEXTURE_WRAP_S: GL_CLAMP_TO_EDGE

  • GL_TEXTURE_WRAP_T: GL_CLAMP_TO_EDGE

    // eglMakeCurrent(...);
    glBindTexture(GL_TEXTURE_2D, m_texture->textureId());
    // ...
Return:

The ID of the texture.

Since:

BlackBerry 10.0.0

Public Slots

void setSize (

Sets the requested size of the texture.

Note:

This operation can be expensive, because a new texture is allocated internally.

Parameters
size

The new size.

Since:

BlackBerry 10.0.0

Signals

void sizeChanged (

Emitted when the size changes.

Since:

BlackBerry 10.0.0

void textureChanged ()

Emitted when the texture ID or appearance of the texture changes.

This signal is typically emitted after a call to WebPageCompositor::renderToTexture(), when the asynchronous rendering completes.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus