Merge "Move boot color sysprop parsing to after loading zips." into sc-qpr1-dev am: a1c0f6dd41 am: 28c7d63d16
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15600978 Change-Id: I0737e969419aa6297b5e4420935fe7804193a1a5
This commit is contained in:
@@ -729,22 +729,6 @@ void BootAnimation::initShaders() {
|
|||||||
glVertexAttribPointer(uvLocation, 2, GL_FLOAT, GL_FALSE, 0, quadUVs);
|
glVertexAttribPointer(uvLocation, 2, GL_FLOAT, GL_FALSE, 0, quadUVs);
|
||||||
glEnableVertexAttribArray(uvLocation);
|
glEnableVertexAttribArray(uvLocation);
|
||||||
|
|
||||||
if (dynamicColoringEnabled) {
|
|
||||||
glUseProgram(mImageShader);
|
|
||||||
SLOGI("[BootAnimation] Dynamically coloring boot animation.");
|
|
||||||
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
|
||||||
float *startColor = mAnimation->startColors[i];
|
|
||||||
float *endColor = mAnimation->endColors[i];
|
|
||||||
glUniform4f(glGetUniformLocation(mImageShader,
|
|
||||||
(U_START_COLOR_PREFIX + std::to_string(i)).c_str()),
|
|
||||||
startColor[0], startColor[1], startColor[2], 1 /* alpha */);
|
|
||||||
glUniform4f(glGetUniformLocation(mImageShader,
|
|
||||||
(U_END_COLOR_PREFIX + std::to_string(i)).c_str()),
|
|
||||||
endColor[0], endColor[1], endColor[2], 1 /* alpha */);
|
|
||||||
}
|
|
||||||
mImageColorProgressLocation = glGetUniformLocation(mImageShader, U_COLOR_PROGRESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize text shader.
|
// Initialize text shader.
|
||||||
mTextShader = linkShader(vertexShader, textFragmentShader);
|
mTextShader = linkShader(vertexShader, textFragmentShader);
|
||||||
positionLocation = glGetAttribLocation(mTextShader, A_POSITION);
|
positionLocation = glGetAttribLocation(mTextShader, A_POSITION);
|
||||||
@@ -1180,12 +1164,6 @@ bool BootAnimation::parseAnimationDesc(Animation& animation) {
|
|||||||
s = ++endl;
|
s = ++endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
|
||||||
parseColorDecimalString(
|
|
||||||
android::base::GetProperty("persist.bootanim.color" + std::to_string(i + 1), ""),
|
|
||||||
animation.endColors[i], animation.startColors[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1362,6 +1340,10 @@ bool BootAnimation::movie() {
|
|||||||
mTimeCheckThread->run("BootAnimation::TimeCheckThread", PRIORITY_NORMAL);
|
mTimeCheckThread->run("BootAnimation::TimeCheckThread", PRIORITY_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mAnimation != nullptr && mAnimation->dynamicColoringEnabled) {
|
||||||
|
initDynamicColors();
|
||||||
|
}
|
||||||
|
|
||||||
playAnimation(*mAnimation);
|
playAnimation(*mAnimation);
|
||||||
|
|
||||||
if (mTimeCheckThread != nullptr) {
|
if (mTimeCheckThread != nullptr) {
|
||||||
@@ -1415,6 +1397,27 @@ void BootAnimation::drawTexturedQuad(float xStart, float yStart, float width, fl
|
|||||||
sizeof(quadPositions) / sizeof(quadPositions[0]) / 2);
|
sizeof(quadPositions) / sizeof(quadPositions[0]) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BootAnimation::initDynamicColors() {
|
||||||
|
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
||||||
|
parseColorDecimalString(
|
||||||
|
android::base::GetProperty("persist.bootanim.color" + std::to_string(i + 1), ""),
|
||||||
|
mAnimation->endColors[i], mAnimation->startColors[i]);
|
||||||
|
}
|
||||||
|
glUseProgram(mImageShader);
|
||||||
|
SLOGI("[BootAnimation] Dynamically coloring boot animation.");
|
||||||
|
for (int i = 0; i < DYNAMIC_COLOR_COUNT; i++) {
|
||||||
|
float *startColor = mAnimation->startColors[i];
|
||||||
|
float *endColor = mAnimation->endColors[i];
|
||||||
|
glUniform4f(glGetUniformLocation(mImageShader,
|
||||||
|
(U_START_COLOR_PREFIX + std::to_string(i)).c_str()),
|
||||||
|
startColor[0], startColor[1], startColor[2], 1 /* alpha */);
|
||||||
|
glUniform4f(glGetUniformLocation(mImageShader,
|
||||||
|
(U_END_COLOR_PREFIX + std::to_string(i)).c_str()),
|
||||||
|
endColor[0], endColor[1], endColor[2], 1 /* alpha */);
|
||||||
|
}
|
||||||
|
mImageColorProgressLocation = glGetUniformLocation(mImageShader, U_COLOR_PROGRESS);
|
||||||
|
}
|
||||||
|
|
||||||
bool BootAnimation::playAnimation(const Animation& animation) {
|
bool BootAnimation::playAnimation(const Animation& animation) {
|
||||||
const size_t pcount = animation.parts.size();
|
const size_t pcount = animation.parts.size();
|
||||||
nsecs_t frameDuration = s2ns(1) / animation.fps;
|
nsecs_t frameDuration = s2ns(1) / animation.fps;
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ private:
|
|||||||
void checkExit();
|
void checkExit();
|
||||||
|
|
||||||
void handleViewport(nsecs_t timestep);
|
void handleViewport(nsecs_t timestep);
|
||||||
|
void initDynamicColors();
|
||||||
|
|
||||||
sp<SurfaceComposerClient> mSession;
|
sp<SurfaceComposerClient> mSession;
|
||||||
AssetManager mAssets;
|
AssetManager mAssets;
|
||||||
|
|||||||
Reference in New Issue
Block a user