summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index a621f1b4c99..a3cc0637670 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -289,6 +289,18 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) {
void Layer::onDraw(const Region& clip) const
{
+#ifdef STE_HARDWARE
+ // Convert the texture to a native format if need be.
+ // convert() returns immediately if no conversion is necessary.
+ if (mSurfaceTexture != NULL) {
+ status_t res = mSurfaceTexture->convert();
+ if (res != NO_ERROR) {
+ LOGE("Layer::onDraw: texture conversion failed. "
+ "Texture content for this layer will not be initialized.");
+ }
+ }
+#endif
+
if (CC_UNLIKELY(mActiveBuffer == 0)) {
// the texture has not been created yet, this Layer has
// in fact never been drawn into. This happens frequently with
@@ -514,7 +526,11 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
if (mSurfaceTexture->updateTexImage(isComposition) < NO_ERROR) {
#else
+#ifndef STE_HARDWARE
if (mSurfaceTexture->updateTexImage() < NO_ERROR) {
+#else
+ if (mSurfaceTexture->updateTexImage(true) < NO_ERROR) {
+#endif
#endif
// something happened!
recomputeVisibleRegions = true;