Merge "libgui: Remove unnecessary casts in SurfaceControl"
This commit is contained in:
commit
017a538516
@ -92,68 +92,57 @@ bool SurfaceControl::isSameSurface(
|
|||||||
status_t SurfaceControl::setLayerStack(int32_t layerStack) {
|
status_t SurfaceControl::setLayerStack(int32_t layerStack) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setLayerStack(mHandle, layerStack);
|
||||||
return client->setLayerStack(mHandle, layerStack);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setLayer(int32_t layer) {
|
status_t SurfaceControl::setLayer(int32_t layer) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setLayer(mHandle, layer);
|
||||||
return client->setLayer(mHandle, layer);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setPosition(float x, float y) {
|
status_t SurfaceControl::setPosition(float x, float y) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setPosition(mHandle, x, y);
|
||||||
return client->setPosition(mHandle, x, y);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setSize(uint32_t w, uint32_t h) {
|
status_t SurfaceControl::setSize(uint32_t w, uint32_t h) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setSize(mHandle, w, h);
|
||||||
return client->setSize(mHandle, w, h);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::hide() {
|
status_t SurfaceControl::hide() {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->hide(mHandle);
|
||||||
return client->hide(mHandle);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::show() {
|
status_t SurfaceControl::show() {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->show(mHandle);
|
||||||
return client->show(mHandle);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setFlags(uint32_t flags, uint32_t mask) {
|
status_t SurfaceControl::setFlags(uint32_t flags, uint32_t mask) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setFlags(mHandle, flags, mask);
|
||||||
return client->setFlags(mHandle, flags, mask);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setTransparentRegionHint(const Region& transparent) {
|
status_t SurfaceControl::setTransparentRegionHint(const Region& transparent) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setTransparentRegionHint(mHandle, transparent);
|
||||||
return client->setTransparentRegionHint(mHandle, transparent);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setAlpha(float alpha) {
|
status_t SurfaceControl::setAlpha(float alpha) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setAlpha(mHandle, alpha);
|
||||||
return client->setAlpha(mHandle, alpha);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
|
status_t SurfaceControl::setMatrix(float dsdx, float dtdx, float dsdy, float dtdy) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setMatrix(mHandle, dsdx, dtdx, dsdy, dtdy);
|
||||||
return client->setMatrix(mHandle, dsdx, dtdx, dsdy, dtdy);
|
|
||||||
}
|
}
|
||||||
status_t SurfaceControl::setCrop(const Rect& crop) {
|
status_t SurfaceControl::setCrop(const Rect& crop) {
|
||||||
status_t err = validate();
|
status_t err = validate();
|
||||||
if (err < 0) return err;
|
if (err < 0) return err;
|
||||||
const sp<SurfaceComposerClient>& client(mClient);
|
return mClient->setCrop(mHandle, crop);
|
||||||
return client->setCrop(mHandle, crop);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status_t SurfaceControl::clearLayerFrameStats() const {
|
status_t SurfaceControl::clearLayerFrameStats() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user