Update ScreenshotClient to take advantage of rotation in surfaceflinger's screencap api
Change-Id: I836649d9d5cd5958ce34e47f26f4a36d2d05d24c
This commit is contained in:
parent
edb86f9f68
commit
d15ef27f9b
@ -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;
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user