Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Issue 157033007: API to Convert Java Bitmap Config to SkBitmap::Config (Closed)

Created:
6 years, 10 months ago by sivag
Modified:
6 years, 9 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, joi+watch-content_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, James Su, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

API to Convert Java Bitmap Config to SkBitmap::Config This patch implements a generic way of mapping Java Bitmap Config to SkBitmap::Config. And we use this API by providing GetScaledContentBitmap with a extra config parameter. It helps in passing the Bitmap.Config.Format from java directly to native, where we can directly get the SkBitmap::Config. BUG=342822 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=253552

Patch Set 1 : API to Convert Java Bitmap Config to SkBitmap::Config #

Total comments: 6

Patch Set 2 : Implement bitmap format string conversion in BitmapHelper. #

Patch Set 3 : Code changed as per review comments. #

Total comments: 8

Patch Set 4 : Added matching enums in native and Java. #

Patch Set 5 : Change function signature and Cleanup #

Total comments: 2

Patch Set 6 : Code changed as per review comments. #

Total comments: 8

Patch Set 7 : Auto generation of Bitmap Format enum in Java and C++. #

Total comments: 4

Patch Set 8 : Code changed as per review comments. #

Total comments: 5

Patch Set 9 : Moving all enum generation related files to ui. #

Total comments: 4

Patch Set 10 : Rebased TOT and handled code review comments. #

Patch Set 11 : Import BitmapFormat before we use this. #

Patch Set 12 : Adding webview dependecy build changes. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -6 lines) Patch
M android_webview/Android.mk View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/all_webview.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/content_view_core_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 2 comments Download
M content/browser/renderer_host/render_widget_host_view_android.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download
M content/public/browser/android/content_view_core.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A ui/android/java/BitmapFormat.template View 1 2 3 4 5 6 7 8 9 1 chunk +14 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java View 1 2 3 4 5 6 7 9 11 1 chunk +22 lines, -0 lines 0 comments Download
M ui/android/ui_android.gyp View 1 2 3 4 5 6 7 8 9 2 chunks +13 lines, -0 lines 0 comments Download
A ui/gfx/android/bitmap_config_list.h View 1 2 3 4 5 6 7 8 1 chunk +15 lines, -0 lines 0 comments Download
M ui/gfx/android/java_bitmap.h View 1 2 3 4 5 6 7 8 2 chunks +13 lines, -2 lines 0 comments Download
M ui/gfx/android/java_bitmap.cc View 1 2 3 4 5 6 7 8 2 chunks +18 lines, -1 line 0 comments Download

Messages

Total messages: 58 (0 generated)
vivekg
Couple of nits! https://codereview.chromium.org/157033007/diff/1/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/157033007/diff/1/content/browser/android/content_view_core_impl.cc#newcode688 content/browser/android/content_view_core_impl.cc:688: jobject bitmap_config, bitmap_config -> jbitmap_config https://codereview.chromium.org/157033007/diff/1/content/browser/android/content_view_core_impl.cc#newcode696 ...
6 years, 10 months ago (2014-02-11 17:06:45 UTC) #1
sivag
PTAL..
6 years, 10 months ago (2014-02-11 17:37:08 UTC) #2
vivekg
https://codereview.chromium.org/157033007/diff/1/ui/gfx/android/java_bitmap.cc File ui/gfx/android/java_bitmap.cc (right): https://codereview.chromium.org/157033007/diff/1/ui/gfx/android/java_bitmap.cc#newcode126 ui/gfx/android/java_bitmap.cc:126: const std::string config_value = base::android::ConvertJavaStringToUTF8(env, const std::string&
6 years, 10 months ago (2014-02-11 17:59:02 UTC) #3
no sievers
Instead of passing a Java object to native and then calling back into Java to ...
6 years, 10 months ago (2014-02-11 18:45:54 UTC) #4
vivekg
On 2014/02/11 18:45:54, sievers wrote: > Instead of passing a Java object to native and ...
6 years, 10 months ago (2014-02-11 19:07:44 UTC) #5
no sievers
On 2014/02/11 19:07:44, vivekg_ wrote: > On 2014/02/11 18:45:54, sievers wrote: > > Instead of ...
6 years, 10 months ago (2014-02-11 19:11:12 UTC) #6
no sievers
On 2014/02/11 19:11:12, sievers wrote: > On 2014/02/11 19:07:44, vivekg_ wrote: > > On 2014/02/11 ...
6 years, 10 months ago (2014-02-11 19:21:07 UTC) #7
sivag
On 2014/02/11 19:21:07, sievers wrote: > On 2014/02/11 19:11:12, sievers wrote: > > On 2014/02/11 ...
6 years, 10 months ago (2014-02-12 17:48:39 UTC) #8
sivag
On 2014/02/11 19:21:07, sievers wrote: > On 2014/02/11 19:11:12, sievers wrote: > > On 2014/02/11 ...
6 years, 10 months ago (2014-02-12 17:55:31 UTC) #9
no sievers
On 2014/02/12 17:55:31, Sikugu wrote: > On 2014/02/11 19:21:07, sievers wrote: > > On 2014/02/11 ...
6 years, 10 months ago (2014-02-12 18:43:37 UTC) #10
sivag
PTAL.. https://codereview.chromium.org/157033007/diff/1/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/157033007/diff/1/content/browser/android/content_view_core_impl.cc#newcode688 content/browser/android/content_view_core_impl.cc:688: jobject bitmap_config, On 2014/02/11 17:06:46, vivekg_ wrote: > ...
6 years, 10 months ago (2014-02-13 16:31:51 UTC) #11
vivekg
https://codereview.chromium.org/157033007/diff/190001/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/190001/ui/gfx/android/java_bitmap.h#newcode54 ui/gfx/android/java_bitmap.h:54: GFX_EXPORT base::android::ScopedJavaLocalRef<jstring> This API need not be exposed to ...
6 years, 10 months ago (2014-02-13 17:09:46 UTC) #12
sivag
Moved the implementation to BitmapHelper.java. PTAL..
6 years, 10 months ago (2014-02-13 17:11:01 UTC) #13
powei
https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h File content/browser/android/content_view_core_impl.h (right): https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h#newcode63 content/browser/android/content_view_core_impl.h:63: jobject bitmap_config, Thanks for the hard work. Would you ...
6 years, 10 months ago (2014-02-13 18:30:11 UTC) #14
vivekg
https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h File content/browser/android/content_view_core_impl.h (right): https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h#newcode63 content/browser/android/content_view_core_impl.h:63: jobject bitmap_config, On 2014/02/13 18:30:11, powei wrote: > Thanks ...
6 years, 10 months ago (2014-02-13 19:02:31 UTC) #15
powei
https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h File content/browser/android/content_view_core_impl.h (right): https://codereview.chromium.org/157033007/diff/190001/content/browser/android/content_view_core_impl.h#newcode63 content/browser/android/content_view_core_impl.h:63: jobject bitmap_config, On 2014/02/13 19:02:32, vivekg_ wrote: > On ...
6 years, 10 months ago (2014-02-13 19:30:20 UTC) #16
no sievers
https://codereview.chromium.org/157033007/diff/190001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java File ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java (right): https://codereview.chromium.org/157033007/diff/190001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java#newcode90 ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java:90: return "ALPHA_8"; Sorry I missed earlier that the strings ...
6 years, 10 months ago (2014-02-13 21:34:23 UTC) #17
sivag
PTAL.. https://codereview.chromium.org/157033007/diff/190001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java File ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java (right): https://codereview.chromium.org/157033007/diff/190001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java#newcode90 ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java:90: return "ALPHA_8"; On 2014/02/13 21:34:24, sievers wrote: > ...
6 years, 10 months ago (2014-02-14 12:24:24 UTC) #18
no sievers
lgtm https://codereview.chromium.org/157033007/diff/370001/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/370001/ui/gfx/android/java_bitmap.h#newcode21 ui/gfx/android/java_bitmap.h:21: typedef enum { nit: use anonymous enum (no ...
6 years, 10 months ago (2014-02-14 18:39:57 UTC) #19
sivag
https://codereview.chromium.org/157033007/diff/370001/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/370001/ui/gfx/android/java_bitmap.h#newcode21 ui/gfx/android/java_bitmap.h:21: typedef enum { On 2014/02/14 18:39:57, sievers wrote: > ...
6 years, 10 months ago (2014-02-17 07:09:50 UTC) #20
sivag
The CQ bit was checked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-17 07:10:00 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/157033007/510001
6 years, 10 months ago (2014-02-17 07:10:08 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-17 07:17:05 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel
6 years, 10 months ago (2014-02-17 07:17:05 UTC) #24
sivag
Hi Yaron, Ted, bullac Please take a look at the content_vew_core and BitmapHelper.java changes. Dana, ...
6 years, 10 months ago (2014-02-17 07:28:47 UTC) #25
bulach
thanks! the idea seems fine, but we have a better mechanism to share the constants ...
6 years, 10 months ago (2014-02-17 10:33:57 UTC) #26
sivag
PTAL .. +Mark for base/* changes. https://codereview.chromium.org/157033007/diff/510001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java File ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java (right): https://codereview.chromium.org/157033007/diff/510001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java#newcode19 ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java:19: private static final ...
6 years, 10 months ago (2014-02-18 16:06:21 UTC) #27
Mark Mentovai
LGTM in base.
6 years, 10 months ago (2014-02-18 16:43:03 UTC) #28
Ted C
lgtm w/ comments https://codereview.chromium.org/157033007/diff/670001/base/android/java/src/org/chromium/base/BitmapFormat.template File base/android/java/src/org/chromium/base/BitmapFormat.template (right): https://codereview.chromium.org/157033007/diff/670001/base/android/java/src/org/chromium/base/BitmapFormat.template#newcode13 base/android/java/src/org/chromium/base/BitmapFormat.template:13: #undef DEFINE_ACTIVITY_STATE undef DEFINE_BITMAP_CONFIG https://codereview.chromium.org/157033007/diff/670001/ui/android/java/src/org/chromium/ui/gfx/BitmapHelper.java File ...
6 years, 10 months ago (2014-02-18 16:45:21 UTC) #29
sivag
Hi Dana, Can you please take a look at ui/gfx/java_bitmap* files. Thanks, Siva https://codereview.chromium.org/157033007/diff/670001/base/android/java/src/org/chromium/base/BitmapFormat.template File ...
6 years, 10 months ago (2014-02-19 10:05:53 UTC) #30
bulach
lgtm, thanks! tiny nit: https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h#newcode30 ui/gfx/android/java_bitmap.h:30: nit: remove extra \n
6 years, 10 months ago (2014-02-19 12:42:57 UTC) #31
danakj
LGTM w/ 2 suggestions. I'm not an owner of ui/gfx/ bitmap code, but this is ...
6 years, 10 months ago (2014-02-19 15:42:30 UTC) #32
sky
Yaron is a better OWNER than me here.
6 years, 10 months ago (2014-02-19 18:13:48 UTC) #33
Yaron
https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h#newcode21 ui/gfx/android/java_bitmap.h:21: #include "base/android/bitmap_config_list.h" Why is this in base? It's only ...
6 years, 10 months ago (2014-02-19 18:26:14 UTC) #34
sivag
https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h File ui/gfx/android/java_bitmap.h (right): https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h#newcode21 ui/gfx/android/java_bitmap.h:21: #include "base/android/bitmap_config_list.h" On 2014/02/19 18:26:14, Yaron wrote: > Why ...
6 years, 10 months ago (2014-02-20 17:13:52 UTC) #35
Yaron
On 2014/02/20 17:13:52, Sikugu wrote: > https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h > File ui/gfx/android/java_bitmap.h (right): > > https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h#newcode21 > ...
6 years, 10 months ago (2014-02-20 18:02:42 UTC) #36
sivag
On 2014/02/20 18:02:42, Yaron wrote: > On 2014/02/20 17:13:52, Sikugu wrote: > > > https://codereview.chromium.org/157033007/diff/730002/ui/gfx/android/java_bitmap.h ...
6 years, 10 months ago (2014-02-25 11:48:21 UTC) #37
Yaron
lgtm with minor changes https://codereview.chromium.org/157033007/diff/940001/ui/android/java/BitmapFormat.template File ui/android/java/BitmapFormat.template (right): https://codereview.chromium.org/157033007/diff/940001/ui/android/java/BitmapFormat.template#newcode10 ui/android/java/BitmapFormat.template:10: interface BitmapFormat { Make public ...
6 years, 10 months ago (2014-02-25 19:50:44 UTC) #38
sivag
Done. https://codereview.chromium.org/157033007/diff/940001/ui/android/java/BitmapFormat.template File ui/android/java/BitmapFormat.template (right): https://codereview.chromium.org/157033007/diff/940001/ui/android/java/BitmapFormat.template#newcode10 ui/android/java/BitmapFormat.template:10: interface BitmapFormat { On 2014/02/25 19:50:45, Yaron wrote: ...
6 years, 10 months ago (2014-02-26 05:50:42 UTC) #39
sivag
The CQ bit was checked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-26 05:50:53 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/157033007/960001
6 years, 10 months ago (2014-02-26 06:12:40 UTC) #41
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-26 08:15:41 UTC) #42
commit-bot: I haz the power
Retried try job too often on android_aosp for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_aosp&number=50725
6 years, 10 months ago (2014-02-26 08:15:42 UTC) #43
sivag
The CQ bit was checked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-26 08:17:01 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/157033007/960001
6 years, 10 months ago (2014-02-26 08:18:42 UTC) #45
sivag
The CQ bit was unchecked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-26 09:01:30 UTC) #46
sivag
The CQ bit was checked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-26 09:04:17 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/157033007/980001
6 years, 10 months ago (2014-02-26 09:05:06 UTC) #48
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-26 10:16:11 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_clang_dbg
6 years, 10 months ago (2014-02-26 10:16:12 UTC) #50
sivag
Hi torne, boliu, PTAL android_webview/Android.mk android_webview/all_webview.gyp changes.
6 years, 10 months ago (2014-02-26 13:38:28 UTC) #51
Torne
android_webview LGTM
6 years, 10 months ago (2014-02-26 14:33:27 UTC) #52
sivag
The CQ bit was checked by siva.gunturi@samsung.com
6 years, 10 months ago (2014-02-26 15:25:25 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/siva.gunturi@samsung.com/157033007/1000001
6 years, 10 months ago (2014-02-26 15:26:12 UTC) #54
commit-bot: I haz the power
Change committed as 253552
6 years, 10 months ago (2014-02-26 19:30:53 UTC) #55
jdduke (slow)
https://codereview.chromium.org/157033007/diff/1000001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/157033007/diff/1000001/content/browser/android/content_view_core_impl.cc#newcode701 content/browser/android/content_view_core_impl.cc:701: jobject jbitmap_config, Any reason we couldn't have simply used ...
6 years, 9 months ago (2014-02-26 20:33:08 UTC) #56
powei
https://codereview.chromium.org/157033007/diff/1000001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/157033007/diff/1000001/content/browser/android/content_view_core_impl.cc#newcode701 content/browser/android/content_view_core_impl.cc:701: jobject jbitmap_config, On 2014/02/26 20:33:09, jdduke wrote: > Any ...
6 years, 9 months ago (2014-02-26 20:38:17 UTC) #57
jdduke (slow)
6 years, 9 months ago (2014-02-26 20:40:31 UTC) #58
Message was sent while issue was closed.
On 2014/02/26 20:38:17, powei wrote:
>
https://codereview.chromium.org/157033007/diff/1000001/content/browser/androi...
> File content/browser/android/content_view_core_impl.cc (right):
> 
>
https://codereview.chromium.org/157033007/diff/1000001/content/browser/androi...
> content/browser/android/content_view_core_impl.cc:701: jobject jbitmap_config,
> On 2014/02/26 20:33:09, jdduke wrote:
> > Any reason we couldn't have simply used an SkBitmap::Config argument type
> here,
> > rather than forcing the caller to supply a Java-backed bitmap config? Can we
> not
> > include SkBitmap.h in public files?
> 
> This was my question in ps#3.  I think the argument was that keeping it
jobject
> lessens the dependency on skia downstream.

OK, sorry for the drive-by!

Powered by Google App Engine
This is Rietveld 408576698