diff options
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index efcdd87..df7fe5c 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -14,9 +14,12 @@ * limitations under the License. */ +#define ATRACE_TAG ATRACE_TAG_GRAPHICS + #include <stdlib.h> #include <stdint.h> #include <sys/types.h> +#include <math.h> #include <cutils/compiler.h> #include <cutils/native_handle.h> @@ -25,11 +28,12 @@ #include <utils/Errors.h> #include <utils/Log.h> #include <utils/StopWatch.h> +#include <utils/Trace.h> #include <ui/GraphicBuffer.h> #include <ui/PixelFormat.h> -#include <surfaceflinger/Surface.h> +#include <gui/Surface.h> #include "clz.h" #include "DisplayHardware/DisplayHardware.h" @@ -38,7 +42,6 @@ #include "Layer.h" #include "SurfaceFlinger.h" #include "SurfaceTextureLayer.h" -#include <math.h> #define DEBUG_RESIZE 0 @@ -267,6 +270,8 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) { void Layer::onDraw(const Region& clip) const { + ATRACE_CALL(); + 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 @@ -365,6 +370,8 @@ bool Layer::isProtected() const uint32_t Layer::doTransaction(uint32_t flags) { + ATRACE_CALL(); + const Layer::State& front(drawingState()); const Layer::State& temp(currentState()); @@ -418,6 +425,8 @@ bool Layer::onPreComposition() { void Layer::lockPageFlip(bool& recomputeVisibleRegions) { + ATRACE_CALL(); + if (mQueuedFrames > 0) { // if we've already called updateTexImage() without going through @@ -450,6 +459,12 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions) mActiveBuffer = mSurfaceTexture->getCurrentBuffer(); mFrameLatencyNeeded = true; + if (oldActiveBuffer == NULL && mActiveBuffer != NULL) { + // the first time we receive a buffer, we need to trigger a + // geometry invalidation. + mFlinger->invalidateHwcGeometry(); + } + const Rect crop(mSurfaceTexture->getCurrentCrop()); const uint32_t transform(mSurfaceTexture->getCurrentTransform()); const uint32_t scalingMode(mSurfaceTexture->getCurrentScalingMode()); @@ -540,6 +555,8 @@ void Layer::lockPageFlip(bool& recomputeVisibleRegions) void Layer::unlockPageFlip( const Transform& planeTransform, Region& outDirtyRegion) { + ATRACE_CALL(); + Region postedRegion(mPostedDirtyRegion); if (!postedRegion.isEmpty()) { mPostedDirtyRegion.clear(); |
