diff options
| author | 2012-05-13 20:42:01 -0700 | |
|---|---|---|
| committer | 2012-06-14 11:56:55 -0700 | |
| commit | 3e8b853d67c737abdb363f9c978e7d83eac4d888 (patch) | |
| tree | 7796273778c9b2e8cf8739a58d0d3925e0deeaea /services/surfaceflinger/LayerBase.cpp | |
| parent | fe6102f07cc3fa8cfa2283e2c51e6d19f056ee7c (diff) | |
refactor HWComposer to break dependency with the HAL headers
HWComposer must abstract the HWC HAL entirely, so that the
HAL can continue to evolve (and break binary compatibility)
without breaking SurfaceFlinger. The HWC data structure had
leaked outside of HWComposer, this is now fixed.
We now have an abstract interface that provide all the
needed functionality, HWCompose provides concrete
implementations of it based on the the HWC version.
Change-Id: I40c4676dc986b682ede5520a1c60efe64037b0bb
Diffstat (limited to 'services/surfaceflinger/LayerBase.cpp')
| -rw-r--r-- | services/surfaceflinger/LayerBase.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 16bac8f79c..fe15dc90a2 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -281,48 +281,34 @@ void LayerBase::unlockPageFlip( const Transform& planeTransform, Region& outDirtyRegion) { } -void LayerBase::setGeometry(hwc_layer_t* hwcl) +void LayerBase::setGeometry(HWComposer::HWCLayerInterface& layer) { - hwcl->compositionType = HWC_FRAMEBUFFER; - hwcl->hints = 0; - hwcl->flags = HWC_SKIP_LAYER; - hwcl->transform = 0; - hwcl->blending = HWC_BLENDING_NONE; + layer.setDefaultState(); // this gives us only the "orientation" component of the transform const State& s(drawingState()); const uint32_t finalTransform = s.transform.getOrientation(); // we can only handle simple transformation if (finalTransform & Transform::ROT_INVALID) { - hwcl->flags = HWC_SKIP_LAYER; + layer.setTransform(0); } else { - hwcl->transform = finalTransform; + layer.setTransform(finalTransform); } if (!isOpaque()) { - hwcl->blending = mPremultipliedAlpha ? - HWC_BLENDING_PREMULT : HWC_BLENDING_COVERAGE; + layer.setBlending(mPremultipliedAlpha ? + HWC_BLENDING_PREMULT : + HWC_BLENDING_COVERAGE); } // scaling is already applied in mTransformedBounds - hwcl->displayFrame.left = mTransformedBounds.left; - hwcl->displayFrame.top = mTransformedBounds.top; - hwcl->displayFrame.right = mTransformedBounds.right; - hwcl->displayFrame.bottom = mTransformedBounds.bottom; - hwcl->visibleRegionScreen.rects = - reinterpret_cast<hwc_rect_t const *>( - visibleRegionScreen.getArray( - &hwcl->visibleRegionScreen.numRects)); - - hwcl->sourceCrop.left = 0; - hwcl->sourceCrop.top = 0; - hwcl->sourceCrop.right = mTransformedBounds.width(); - hwcl->sourceCrop.bottom = mTransformedBounds.height(); -} - -void LayerBase::setPerFrameData(hwc_layer_t* hwcl) { - hwcl->compositionType = HWC_FRAMEBUFFER; - hwcl->handle = NULL; + layer.setFrame(mTransformedBounds); + layer.setVisibleRegionScreen(visibleRegionScreen); + layer.setCrop(mTransformedBounds.getBounds()); +} + +void LayerBase::setPerFrameData(HWComposer::HWCLayerInterface& layer) { + layer.setBuffer(0); } void LayerBase::setFiltering(bool filtering) |