Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
build
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
lf
build
Commits
be614f3c
Commit
be614f3c
authored
11 years ago
by
Diego Wilson
Committed by
Gerrit - the friendly Code Review server
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove gecko/HWC-multirect-visible-region.patch
Landed upstream \o/ Change-Id: Id5a678690e077b85a199cccc4d89043a2f6a73c5
parent
475fa7c0
No related branches found
Branches containing commit
Tags
AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.099
AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.100
AU_LINUX_GECKO_ICS_STRAWBERRY_V1.01.00.01.019.102
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patch/all/gecko/HWC-multirect-visible-region.patch
+0
-183
0 additions, 183 deletions
patch/all/gecko/HWC-multirect-visible-region.patch
with
0 additions
and
183 deletions
patch/all/gecko/HWC-multirect-visible-region.patch
deleted
100644 → 0
+
0
−
183
View file @
475fa7c0
diff --git a/widget/gonk/HwcComposer2D.cpp b/widget/gonk/HwcComposer2D.cpp
index 96a27ce..42f4b1e 100644
--- a/widget/gonk/HwcComposer2D.cpp
+++ b/widget/gonk/HwcComposer2D.cpp
@@ -166,7 +166,7 @@
PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
//clip to buffer size
crop.IntersectRect(crop, aBufferRect);
- crop.RoundOut();
+ crop.RoundIn();
if (crop.IsEmpty()) {
LOGD("Skip layer");
@@ -175,7 +175,7 @@
PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
//propagate buffer clipping back to visible rect
visibleRectScreen = aTransform.TransformBounds(crop);
- visibleRectScreen.RoundOut();
+ visibleRectScreen.RoundIn();
// Map from layer space to buffer space
crop -= aBufferRect.TopLeft();
@@ -194,6 +194,54 @@
PrepareLayerRects(nsIntRect aVisible, const gfxMatrix& aTransform,
}
/**
+ * Prepares hwc layer visible region required for hwc composition
+ *
+ * @param aVisible Input. Layer's unclipped visible region
+ * The origin is the top-left corner of the layer
+ * @param aTransform Input. Layer's transformation matrix
+ * It transforms from layer space to screen space
+ * @param aClip Input. A clipping rectangle.
+ * The origin is the top-left corner of the screen
+ * @param aBufferRect Input. The layer's buffer bounds
+ * The origin is the top-left corner of the layer
+ * @param aVisibleRegionScreen Output. Visible region in screen space.
+ * The origin is the top-left corner of the screen
+ * @return true if the layer should be rendered.
+ * false if the layer can be skipped
+ */
+static bool
+PrepareVisibleRegion(const nsIntRegion& aVisible, const gfxMatrix& aTransform,
+ nsIntRect aClip, nsIntRect aBufferRect,
+ std::vector<hwc_rect_t>* aVisibleRegionScreen) {
+
+ nsIntRegionRectIterator iter(aVisible);
+ bool isVisible = false;
+ while (const nsIntRect* visibleRect = iter.Next()) {
+ hwc_rect_t visibleRectScreen;
+
+ gfxRect gfxVisibleRect(*visibleRect);
+ gfxVisibleRect.IntersectRect(gfxVisibleRect, aBufferRect);
+ gfxRect gfxVisibleRectScreen = aTransform.TransformBounds(gfxVisibleRect);
+ gfxVisibleRectScreen.IntersectRect(gfxVisibleRectScreen, aClip);
+ gfxVisibleRectScreen.RoundIn();
+ if(gfxVisibleRectScreen.IsEmpty()) {
+ continue;
+ }
+ visibleRectScreen.left = gfxVisibleRectScreen.x;
+ visibleRectScreen.top = gfxVisibleRectScreen.y;
+ visibleRectScreen.right = gfxVisibleRectScreen.x + gfxVisibleRectScreen.width;
+ visibleRectScreen.bottom = gfxVisibleRectScreen.y + gfxVisibleRectScreen.height;
+ aVisibleRegionScreen->push_back(visibleRectScreen);
+ isVisible = true;
+ }
+ if(!isVisible) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
* Calculates the layer's clipping rectangle
*
* @param aTransform Input. A transformation matrix
@@ -251,21 +299,11 @@
HwcComposer2D::PrepareLayerList(Layer* aLayer,
}
float opacity = aLayer->GetEffectiveOpacity();
- if (opacity <= 0) {
- LOGD("Layer is fully transparent so skip rendering");
- return true;
- }
- else if (opacity < 1) {
+ if (opacity < 1) {
LOGD("Layer has planar semitransparency which is unsupported");
return false;
}
- if (visibleRegion.GetNumRects() > 1) {
- // FIXME/bug 808339
- LOGD("Layer has nontrivial visible region");
- return false;
- }
-
nsIntRect clip;
if (!CalculateClipRect(aParentTransform * aGLWorldTransform,
aLayer->GetEffectiveClipRect(),
@@ -330,7 +368,14 @@
HwcComposer2D::PrepareLayerList(Layer* aLayer,
sp<GraphicBuffer> buffer = fillColor ? nullptr : GrallocBufferActor::GetFrom(*state.mSurface);
- nsIntRect visibleRect = visibleRegion.GetBounds();
+ nsIntRect visibleRect;
+ if (aLayer->Name() == "ShadowCanvasLayer" || aLayer->Name() == "ShadowImageLayer") {
+ visibleRect = nsIntRect(0, 0,
+ int(buffer->getWidth()), int(buffer->getHeight()));
+ }
+ else {
+ visibleRect = visibleRegion.GetBounds();
+ }
nsIntRect bufferRect;
if (fillColor) {
@@ -385,13 +430,33 @@
HwcComposer2D::PrepareLayerList(Layer* aLayer,
hwcLayer.transform |= state.YFlipped() ? HWC_TRANSFORM_FLIP_V : 0;
hwc_region_t region;
- region.numRects = 1;
- region.rects = &(hwcLayer.displayFrame);
+ if (visibleRegion.GetNumRects() > 1) {
+ std::vector<hwc_rect_t> visibleRects;
+ mVisibleRegions.push_back(visibleRects);
+ if(!PrepareVisibleRegion(visibleRegion,
+ transform * aGLWorldTransform,
+ clip,
+ bufferRect,
+ &(mVisibleRegions.back()))) {
+ return true;
+ }
+ region.numRects = mVisibleRegions.back().size();
+ region.rects = &(mVisibleRegions.back()[0]);
+ }
+ else {
+ region.numRects = 1;
+ region.rects = &(hwcLayer.displayFrame);
+ }
hwcLayer.visibleRegionScreen = region;
} else {
hwcLayer.flags |= HWC_COLOR_FILL;
ColorLayer* colorLayer = static_cast<ColorLayer*>(layerGL->GetLayer());
- hwcLayer.transform = colorLayer->GetColor().Packed();
+ uint32_t color = colorLayer->GetColor().Packed();
+ if (((color >> 24) & 0xff) < 255) {
+ LOGD("Color layer has semitransparency which is unsupported");
+ return false;
+ }
+ hwcLayer.transform = color;
}
mList->numHwLayers++;
@@ -412,6 +477,8 @@
HwcComposer2D::TryRender(Layer* aRoot,
mList->numHwLayers = 0;
}
+ mVisibleRegions.clear();
+
if (!PrepareLayerList(aRoot,
mScreenRect,
gfxMatrix(),
diff --git a/widget/gonk/HwcComposer2D.h b/widget/gonk/HwcComposer2D.h
index 7c69af6..74b0578 100644
--- a/widget/gonk/HwcComposer2D.h
+++ b/widget/gonk/HwcComposer2D.h
@@ -20,6 +20,8 @@
#include "Composer2D.h"
#include "HWComposer.h"
#include "Layers.h"
+#include <vector>
+#include <list>
namespace mozilla {
@@ -54,6 +56,7 @@
private:
nsIntRect mScreenRect;
int mMaxLayerCount;
bool mColorFill;
+ std::list<std::vector<hwc_rect_t>> mVisibleRegions;
};
} // namespace mozilla
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment