graphics: correctly pass layer alpha level through
This commit is contained in:
parent
238a26aee3
commit
1037e8aab9
9 changed files with 28 additions and 25 deletions
|
|
@ -197,6 +197,7 @@ static int hwc_set(hwc_composer_device_1_t* dev, size_t numDisplays,
|
|||
rcEnc->rcPostLayer(rcEnc,
|
||||
layer->name,
|
||||
cb->hostHandle,
|
||||
layer->planeAlpha / 255,
|
||||
layer->sourceCrop.left,
|
||||
layer->sourceCrop.top,
|
||||
layer->sourceCrop.right,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ typedef int (renderControl_APIENTRY *rcGetDisplayHeight_client_proc_t) (void * c
|
|||
typedef int (renderControl_APIENTRY *rcGetDisplayDpiX_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef int (renderControl_APIENTRY *rcGetDisplayDpiY_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef int (renderControl_APIENTRY *rcGetDisplayVsyncPeriod_client_proc_t) (void * ctx, uint32_t);
|
||||
typedef void (renderControl_APIENTRY *rcPostLayer_client_proc_t) (void * ctx, const char*, uint32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
|
||||
typedef void (renderControl_APIENTRY *rcPostLayer_client_proc_t) (void * ctx, const char*, uint32_t, float, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t);
|
||||
typedef void (renderControl_APIENTRY *rcPostAllLayersDone_client_proc_t) (void * ctx);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1283,7 +1283,7 @@ int rcGetDisplayVsyncPeriod_enc(void *self , uint32_t displayId)
|
|||
return retval;
|
||||
}
|
||||
|
||||
void rcPostLayer_enc(void *self , const char* name, uint32_t colorBuffer, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom)
|
||||
void rcPostLayer_enc(void *self , const char* name, uint32_t colorBuffer, float alpha, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom)
|
||||
{
|
||||
|
||||
renderControl_encoder_context_t *ctx = (renderControl_encoder_context_t *)self;
|
||||
|
|
@ -1294,7 +1294,7 @@ void rcPostLayer_enc(void *self , const char* name, uint32_t colorBuffer, int32_
|
|||
const unsigned int __size_name = (strlen(name) + 1);
|
||||
unsigned char *ptr;
|
||||
unsigned char *buf;
|
||||
const size_t sizeWithoutChecksum = 8 + __size_name + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1*4;
|
||||
const size_t sizeWithoutChecksum = 8 + __size_name + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1*4;
|
||||
const size_t checksumSize = checksumCalculator->checksumByteSize();
|
||||
const size_t totalSize = sizeWithoutChecksum + checksumSize;
|
||||
buf = stream->alloc(totalSize);
|
||||
|
|
@ -1305,6 +1305,7 @@ void rcPostLayer_enc(void *self , const char* name, uint32_t colorBuffer, int32_
|
|||
*(unsigned int *)(ptr) = __size_name; ptr += 4;
|
||||
memcpy(ptr, name, __size_name);ptr += __size_name;
|
||||
memcpy(ptr, &colorBuffer, 4); ptr += 4;
|
||||
memcpy(ptr, &alpha, 4); ptr += 4;
|
||||
memcpy(ptr, &sourceCropLeft, 4); ptr += 4;
|
||||
memcpy(ptr, &sourceCropTop, 4); ptr += 4;
|
||||
memcpy(ptr, &sourceCropRight, 4); ptr += 4;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ extern "C" {
|
|||
int rcGetDisplayDpiX(uint32_t displayId);
|
||||
int rcGetDisplayDpiY(uint32_t displayId);
|
||||
int rcGetDisplayVsyncPeriod(uint32_t displayId);
|
||||
void rcPostLayer(const char* name, uint32_t colorBuffer, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom);
|
||||
void rcPostLayer(const char* name, uint32_t colorBuffer, float alpha, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom);
|
||||
void rcPostAllLayersDone();
|
||||
};
|
||||
|
||||
|
|
@ -262,10 +262,10 @@ int rcGetDisplayVsyncPeriod(uint32_t displayId)
|
|||
return ctx->rcGetDisplayVsyncPeriod(ctx, displayId);
|
||||
}
|
||||
|
||||
void rcPostLayer(const char* name, uint32_t colorBuffer, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom)
|
||||
void rcPostLayer(const char* name, uint32_t colorBuffer, float alpha, int32_t sourceCropLeft, int32_t sourceCropTop, int32_t sourceCropRight, int32_t sourceCropBottom, int32_t displayFrameLeft, int32_t displayFrameTop, int32_t displayFrameRight, int32_t displayFrameBottom)
|
||||
{
|
||||
GET_CONTEXT;
|
||||
ctx->rcPostLayer(ctx, name, colorBuffer, sourceCropLeft, sourceCropTop, sourceCropRight, sourceCropBottom, displayFrameLeft, displayFrameTop, displayFrameRight, displayFrameBottom);
|
||||
ctx->rcPostLayer(ctx, name, colorBuffer, alpha, sourceCropLeft, sourceCropTop, sourceCropRight, sourceCropBottom, displayFrameLeft, displayFrameTop, displayFrameRight, displayFrameBottom);
|
||||
}
|
||||
|
||||
void rcPostAllLayersDone()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue