Fix getConfig function for hw bitmaps
Test: HardwareBitmapTests#testGetConfig bug:30999911 Change-Id: I93a1c9fc88567ada2462a7a3b6cef8f796844e15
This commit is contained in:
@@ -712,6 +712,9 @@ static jint Bitmap_rowBytes(JNIEnv* env, jobject, jlong bitmapHandle) {
|
||||
|
||||
static jint Bitmap_config(JNIEnv* env, jobject, jlong bitmapHandle) {
|
||||
LocalScopedBitmap bitmap(bitmapHandle);
|
||||
if (bitmap->bitmap().isHardware()) {
|
||||
return GraphicsJNI::hardwareLegacyBitmapConfig();
|
||||
}
|
||||
return GraphicsJNI::colorTypeToLegacyBitmapConfig(bitmap->info().colorType());
|
||||
}
|
||||
|
||||
|
||||
@@ -366,6 +366,10 @@ bool GraphicsJNI::isHardwareConfig(JNIEnv* env, jobject jconfig) {
|
||||
return c == kHardware_LegacyBitmapConfig;
|
||||
}
|
||||
|
||||
jint GraphicsJNI::hardwareLegacyBitmapConfig() {
|
||||
return kHardware_LegacyBitmapConfig;
|
||||
}
|
||||
|
||||
android::Canvas* GraphicsJNI::getNativeCanvas(JNIEnv* env, jobject canvas) {
|
||||
SkASSERT(env);
|
||||
SkASSERT(canvas);
|
||||
|
||||
@@ -69,6 +69,7 @@ public:
|
||||
static SkColorType getNativeBitmapColorType(JNIEnv*, jobject jconfig);
|
||||
|
||||
static bool isHardwareConfig(JNIEnv* env, jobject jconfig);
|
||||
static jint hardwareLegacyBitmapConfig();
|
||||
|
||||
static jobject createRegion(JNIEnv* env, SkRegion* region);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user