Skip to content

Commit

Permalink
frameworks/base: surfaceflinger: Increase min texture width limit
Browse files Browse the repository at this point in the history
Increase minimum texture width limit to 480
and it should be multiple of 16 for
vertical stripes optimization.

(cherry picked from commit 624055c0927097e7db1ebc6fe025f6c66b9bca01)

Change-Id: I24d1396842590c0c39b64b80420148e26efe1772
  • Loading branch information
Omprakash Dhyade authored and hyperb1iss committed Oct 29, 2011
1 parent f738285 commit 8c556d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion services/surfaceflinger/LayerBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,8 @@ void LayerBase::drawWithOpenGLOptimized(const Region& clip, const Texture& textu
int tWidth = mTransformedBounds.right - mTransformedBounds.left;
if (((mOrientation == HAL_TRANSFORM_ROT_90)
|| (mOrientation == HAL_TRANSFORM_ROT_270))
&& (tWidth > getQuadWidth()) && !transform) {
&& !(tWidth % getQuadWidth())
&& (tWidth > getTexMinWidth()) && !transform) {

/*
* We divide the texture in vertical quads
Expand Down
3 changes: 2 additions & 1 deletion services/surfaceflinger/LayerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ class LayerBase : public RefBase
void clearWithOpenGL(const Region& clip) const;
void drawWithOpenGL(const Region& clip, const Texture& texture) const;
void drawWithOpenGLOptimized(const Region& clip, const Texture& texture) const;
enum { QUAD_WIDTH = 16 };
enum { QUAD_WIDTH = 16, TEXTURE_MIN_WIDTH = 480 };
int getQuadWidth() const { return QUAD_WIDTH; }
int getTexMinWidth() const { return TEXTURE_MIN_WIDTH; }

// these must be called from the post/drawing thread
void setBufferCrop(const Rect& crop);
Expand Down

0 comments on commit 8c556d9

Please sign in to comment.