am d15ef27f: Update ScreenshotClient to take advantage of rotation in surfaceflinger\'s screencap api

* commit 'd15ef27f9b13727fa7358e3c09572f66bb1e0668':
  Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api
This commit is contained in:
Riley Andrews 2014-09-09 21:55:45 +00:00 committed by Android Git Automerger
commit 75ec33e0e6
2 changed files with 18 additions and 4 deletions

View File

@ -209,6 +209,10 @@ public:
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform);
status_t update(const sp<IBinder>& display,
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform, uint32_t rotation);
sp<CpuConsumer> getCpuConsumer() const;

View File

@ -717,7 +717,7 @@ sp<CpuConsumer> ScreenshotClient::getCpuConsumer() const {
status_t ScreenshotClient::update(const sp<IBinder>& display,
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform) {
bool useIdentityTransform, uint32_t rotation) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
sp<CpuConsumer> cpuConsumer = getCpuConsumer();
@ -729,7 +729,8 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
}
status_t err = s->captureScreen(display, mProducer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform);
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform,
static_cast<ISurfaceComposer::Rotation>(rotation));
if (err == NO_ERROR) {
err = mCpuConsumer->lockNextBuffer(&mBuffer);
@ -740,16 +741,25 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
return err;
}
status_t ScreenshotClient::update(const sp<IBinder>& display,
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform) {
return ScreenshotClient::update(display, sourceCrop, reqWidth, reqHeight,
minLayerZ, maxLayerZ, useIdentityTransform, ISurfaceComposer::eRotateNone);
}
status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
bool useIdentityTransform) {
return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1UL,
useIdentityTransform);
useIdentityTransform, ISurfaceComposer::eRotateNone);
}
status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform) {
return ScreenshotClient::update(display, sourceCrop, reqWidth, reqHeight,
0, -1UL, useIdentityTransform);
0, -1UL, useIdentityTransform, ISurfaceComposer::eRotateNone);
}
void ScreenshotClient::release() {