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

Side by Side Diff: ui/android/java/src/org/chromium/ui/resources/ResourceFactory.java

Issue 2746483003: ui/android: Fix Resource meta-data sharing with ResourceManager. (Closed)
Patch Set: jni Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package org.chromium.ui.resources;
6
7 import android.graphics.Rect;
8
9 import org.chromium.base.annotations.JNINamespace;
10 import org.chromium.ui.resources.statics.NinePatchData;
11
12 /**
13 * A utility class for creating native resources.
14 */
15 @JNINamespace("ui")
16 public class ResourceFactory {
17 public static long createBitmapResource(NinePatchData ninePatchData) {
18 return ninePatchData == null ? nativeCreateBitmapResource()
19 : createNinePatchBitmapResource(ninePatchDa ta.getPadding(),
20 ninePatchData.getAperture());
21 }
22
23 // Make this private in https://codereview.chromium.org/2752693003/
24 public static long createNinePatchBitmapResource(Rect padding, Rect aperture ) {
25 return nativeCreateNinePatchBitmapResource(padding.left, padding.top, pa dding.right,
26 padding.bottom, aperture.left, aperture.top, aperture.right, ape rture.bottom);
27 }
28
29 private static native long nativeCreateBitmapResource();
30 private static native long nativeCreateNinePatchBitmapResource(int paddingLe ft, int paddingTop,
31 int paddingRight, int paddingBottom, int apertureLeft, int apertureT op,
32 int apertureRight, int apertureBottom);
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698