refactor the crop region for hwc is calculated/set
- the crop region is now always calculated and set
in LayerBase::setGeometry which uses new virtuals to
access the "content" crop and transform (which are
provided by the Layer subclass)
Change-Id: Ib7769bdec0917dd248f926600c14ddf9ea84897a
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index c2624df..ecae2d9 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -260,6 +260,18 @@
*/
virtual void updateTransformHint(const sp<const DisplayDevice>& hw) const { }
+ /**
+ * returns the rectangle that crops the content of the layer and scales it
+ * to the layer's size.
+ */
+ virtual Rect getContentCrop() const;
+
+ /*
+ * returns the transform bits (90 rotation / h-flip / v-flip) of the
+ * layer's content
+ */
+ virtual uint32_t getContentTransform() const;
+
/** always call base class first */
virtual void dump(String8& result, char* scratch, size_t size) const;
virtual void shortDump(String8& result, char* scratch, size_t size) const;
@@ -282,6 +294,9 @@
void setFiltering(bool filtering);
bool getFiltering() const;
+private:
+ Rect computeCrop(const sp<const DisplayDevice>& hw) const;
+
protected:
void clearWithOpenGL(const sp<const DisplayDevice>& hw, const Region& clip,
GLclampf r, GLclampf g, GLclampf b, GLclampf alpha) const;