Chromium Code Reviews| Index: ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java |
| diff --git a/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java b/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java |
| index 10eb53a3188bfc8700239f1e482b7bd76a375b2e..c9054a2d519e6cb98ee3a8b4fad6b49ca1856870 100644 |
| --- a/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java |
| +++ b/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java |
| @@ -2,7 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -package org.chromium.ui.gfx; |
| +package org.chromium.ui; |
|
Yaron
2014/02/25 19:50:45
This needs to be in org.chromium.ui.gfx to match p
sivag
2014/02/26 05:50:43
Done.
|
| import android.content.res.Resources; |
| import android.graphics.Bitmap; |
| @@ -75,4 +75,26 @@ public class BitmapHelper { |
| return inSampleSize; |
| } |
| + |
| + /** |
| + * Provides a matching integer constant for the Bitmap.Config value passed. |
| + * |
| + * @param bitmapConfig The Bitmap Configuration value. |
| + * @return Matching integer constant for the Bitmap.Config value passed. |
| + */ |
| + @CalledByNative |
| + private static int bitmapConfig(Bitmap.Config bitmapConfig) { |
| + switch (bitmapConfig) { |
| + case ALPHA_8: |
| + return BitmapFormat.FORMAT_ALPHA_8; |
| + case ARGB_4444: |
| + return BitmapFormat.FORMAT_ARGB_4444; |
| + case ARGB_8888: |
| + return BitmapFormat.FORMAT_ARGB_8888; |
| + case RGB_565: |
| + return BitmapFormat.FORMAT_RGB_565; |
| + default: |
| + return BitmapFormat.FORMAT_NO_CONFIG; |
| + } |
| + } |
| } |