summaryrefslogtreecommitdiffstats
path: root/services/surfaceflinger
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r--services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.cpp15
-rw-r--r--services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.h5
2 files changed, 20 insertions, 0 deletions
diff --git a/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.cpp b/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.cpp
index 965ff01..0c94c7d 100644
--- a/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.cpp
+++ b/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.cpp
@@ -26,6 +26,9 @@ namespace android {
// ----------------------------------------------------------------------------
GraphicBufferAlloc::GraphicBufferAlloc() {
+#ifdef QCOM_BSP
+ mBufferSize = 0;
+#endif
}
GraphicBufferAlloc::~GraphicBufferAlloc() {
@@ -33,7 +36,13 @@ GraphicBufferAlloc::~GraphicBufferAlloc() {
sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h,
PixelFormat format, uint32_t usage, status_t* error) {
+#ifdef QCOM_BSP
+ sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(w, h, format,
+ usage, mBufferSize));
+#else
sp<GraphicBuffer> graphicBuffer(new GraphicBuffer(w, h, format, usage));
+#endif
+
status_t err = graphicBuffer->initCheck();
*error = err;
if (err != 0 || graphicBuffer->handle == 0) {
@@ -48,6 +57,12 @@ sp<GraphicBuffer> GraphicBufferAlloc::createGraphicBuffer(uint32_t w, uint32_t h
return graphicBuffer;
}
+#ifdef QCOM_BSP
+void GraphicBufferAlloc::setGraphicBufferSize(int size) {
+ mBufferSize = size;
+}
+#endif
+
// ----------------------------------------------------------------------------
}; // namespace android
// ----------------------------------------------------------------------------
diff --git a/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.h b/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.h
index b08750c..521383d 100644
--- a/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.h
+++ b/services/surfaceflinger/DisplayHardware/GraphicBufferAlloc.h
@@ -35,6 +35,11 @@ public:
virtual ~GraphicBufferAlloc();
virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
PixelFormat format, uint32_t usage, status_t* error);
+#ifdef QCOM_BSP
+ virtual void setGraphicBufferSize(int size);
+private:
+ int mBufferSize;
+#endif
};