Skip to content

Commit 5c09e8a

Browse files
ChrisCraikAndroid (Google) Code Review
authored andcommitted
Merge "Remove scaling bucket hack" into lmp-dev
2 parents a47316c + a736cd9 commit 5c09e8a

3 files changed

Lines changed: 7 additions & 41 deletions

File tree

libs/hwui/Caches.cpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,6 @@ TextureVertex* Caches::getRegionMesh() {
699699
///////////////////////////////////////////////////////////////////////////////
700700

701701
void Caches::initTempProperties() {
702-
propertyAmbientShadowStrength = 12;
703-
propertySpotShadowStrength = 48;
704-
705702
propertyLightDiameter = -1.0f;
706703
propertyLightPosY = -1.0f;
707704
propertyLightPosZ = -1.0f;
@@ -710,15 +707,7 @@ void Caches::initTempProperties() {
710707

711708
void Caches::setTempProperty(const char* name, const char* value) {
712709
ALOGD("setting property %s to %s", name, value);
713-
if (!strcmp(name, "ambientShadowStrength")) {
714-
propertyAmbientShadowStrength = atoi(value);
715-
ALOGD("ambient shadow strength = 0x%x out of 0xff", propertyAmbientShadowStrength);
716-
return;
717-
} else if (!strcmp(name, "spotShadowStrength")) {
718-
propertySpotShadowStrength = atoi(value);
719-
ALOGD("spot shadow strength = 0x%x out of 0xff", propertySpotShadowStrength);
720-
return;
721-
} else if (!strcmp(name, "ambientRatio")) {
710+
if (!strcmp(name, "ambientRatio")) {
722711
propertyAmbientRatio = fmin(fmax(atof(value), 0.0), 10.0);
723712
ALOGD("ambientRatio = %.2f", propertyAmbientRatio);
724713
return;
@@ -734,10 +723,6 @@ void Caches::setTempProperty(const char* name, const char* value) {
734723
propertyLightPosZ = fmin(fmax(atof(value), 0.0), 3000.0);
735724
ALOGD("lightPos Z = %.2f", propertyLightPosZ);
736725
return;
737-
} else if (!strcmp(name, "extraRasterBucket")) {
738-
float bucket = atof(value);
739-
propertyExtraRasterBuckets.push_back(bucket);
740-
return;
741726
}
742727
ALOGD(" failed");
743728
}

libs/hwui/Caches.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ class ANDROID_API Caches: public Singleton<Caches> {
366366
float propertyLightPosY;
367367
float propertyLightPosZ;
368368
float propertyAmbientRatio;
369-
int propertyAmbientShadowStrength;
370-
int propertySpotShadowStrength;
371-
std::vector<float> propertyExtraRasterBuckets;
372369
private:
373370
enum OverdrawColorSet {
374371
kColorSet_Default = 0,

libs/hwui/OpenGLRenderer.cpp

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2809,31 +2809,15 @@ bool OpenGLRenderer::findBestFontTransform(const mat4& transform, SkMatrix* outM
28092809
}
28102810

28112811
/**
2812-
* Input is a non-perspective, scaling transform. Generate a scale-only transform, based upon
2813-
* bucketed scale values. Special case for 'extra raster buckets' - disable filtration in the
2814-
* case of an exact match, and isSimple() transform
2812+
* Input is a non-perspective, scaling transform. Generate a scale-only transform,
2813+
* with values rounded to the nearest int.
28152814
*/
28162815
float sx, sy;
28172816
transform.decomposeScale(sx, sy);
2818-
2819-
float bestSx = roundf(fmaxf(1.0f, sx));
2820-
float bestSy = roundf(fmaxf(1.0f, sy));
2821-
bool filter = true;
2822-
2823-
for (unsigned int i = 0; i < mCaches.propertyExtraRasterBuckets.size(); i++) {
2824-
float bucket = mCaches.propertyExtraRasterBuckets[i];
2825-
if (sx == bucket && sy == bucket) {
2826-
bestSx = bestSy = bucket;
2827-
filter = !transform.isSimple(); // disable filter, if simple
2828-
break;
2829-
}
2830-
2831-
if (fabs(bucket - sx) < fabs(bestSx - sx)) bestSx = sx;
2832-
if (fabs(bucket - sy) < fabs(bestSy - sy)) bestSy = sy;
2833-
}
2834-
2835-
outMatrix->setScale(bestSx, bestSy);
2836-
return filter;
2817+
outMatrix->setScale(
2818+
roundf(fmaxf(1.0f, sx)),
2819+
roundf(fmaxf(1.0f, sy)));
2820+
return true;
28372821
}
28382822

28392823
status_t OpenGLRenderer::drawText(const char* text, int bytesCount, int count, float x, float y,

0 commit comments

Comments
 (0)