@@ -244,9 +244,6 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) {
244244 }
245245}
246246
247- static inline uint16_t pack565 (int r, int g, int b) {
248- return (r<<11 )|(g<<5 )|b;
249- }
250247void Layer::onDraw (const Region& clip) const
251248{
252249 if (CC_UNLIKELY (mActiveBuffer == 0 )) {
@@ -260,7 +257,8 @@ void Layer::onDraw(const Region& clip) const
260257
261258 // figure out if there is something below us
262259 Region under;
263- const SurfaceFlinger::LayerVector& drawingLayers (mFlinger ->mDrawingState .layersSortedByZ );
260+ const SurfaceFlinger::LayerVector& drawingLayers (
261+ mFlinger ->mDrawingState .layersSortedByZ );
264262 const size_t count = drawingLayers.size ();
265263 for (size_t i=0 ; i<count ; ++i) {
266264 const sp<LayerBase>& layer (drawingLayers[i]);
@@ -276,7 +274,7 @@ void Layer::onDraw(const Region& clip) const
276274 return ;
277275 }
278276
279- GLenum target = mSurfaceTexture -> getCurrentTextureTarget () ;
277+ const GLenum target = GL_TEXTURE_EXTERNAL_OES ;
280278 glBindTexture (target, mTextureName );
281279 if (getFiltering () || needsFiltering () || isFixedSize () || isCropped ()) {
282280 // TODO: we could be more subtle with isFixedSize()
@@ -439,9 +437,8 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions)
439437 recomputeVisibleRegions = true ;
440438 }
441439
442- const GLenum target (mSurfaceTexture ->getCurrentTextureTarget ());
443- glTexParameterx (target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
444- glTexParameterx (target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
440+ glTexParameterx (GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
441+ glTexParameterx (GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
445442
446443 // update the layer size and release freeze-lock
447444 const Layer::State& front (drawingState ());
0 commit comments