Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b994191 authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Update includes to begin isolating graphics classes.

GraphicsJNI.h will only be visible to files in the graphics component
and this CL begins to remove all usages of that header that are known
to be outside the graphic component.

Test: compile
Bug: 137655431
Change-Id: If310782e5d95d05ab7cbd54dafa5771d315707a7
parent 95eab8ae
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -18,8 +18,9 @@

#include <jni.h>
#include <android/bitmap.h>
#include <SkBitmap.h>
#include <SkImageInfo.h>

class SkBitmap;
struct SkImageInfo;

namespace android {

@@ -34,8 +35,8 @@ enum BitmapCreateFlags {
};

jobject createBitmap(JNIEnv* env, Bitmap* bitmap,
            int bitmapCreateFlags, jbyteArray ninePatchChunk = NULL,
            jobject ninePatchInsets = NULL, int density = -1);
            int bitmapCreateFlags, jbyteArray ninePatchChunk = nullptr,
            jobject ninePatchInsets = nullptr, int density = -1);


void toSkBitmap(jlong bitmapHandle, SkBitmap* outBitmap);
+9 −5
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

#include "jni.h"
#include <nativehelper/JNIHelp.h>
#include "GraphicsJNI.h"

#include <math.h>
#include <stdio.h>
@@ -33,6 +32,7 @@
#include <SkBitmap.h>

#include "core_jni_helpers.h"
#include "android/graphics/Bitmap.h"

#undef LOG_TAG
#define LOG_TAG "OpenGLUtil"
@@ -43,6 +43,10 @@

namespace android {

static void doThrowIAE(JNIEnv* env, const char* msg = nullptr) {
    jniThrowException(env, "java/lang/IllegalArgumentException", msg);
}

static inline
void mx4transform(float x, float y, float z, float w, const float* pM, float* pDest) {
    pDest[0] = pM[0 + 4 * 0] * x + pM[0 + 4 * 1] * y + pM[0 + 4 * 2] * z + pM[0 + 4 * 3] * w;
@@ -706,7 +710,7 @@ static jint util_getInternalFormat(JNIEnv *env, jclass clazz,
        jlong bitmapPtr)
{
    SkBitmap nativeBitmap;
    bitmap::toBitmap(bitmapPtr).getSkBitmap(&nativeBitmap);
    bitmap::toSkBitmap(bitmapPtr, &nativeBitmap);
    return getInternalFormat(nativeBitmap.colorType());
}

@@ -714,7 +718,7 @@ static jint util_getType(JNIEnv *env, jclass clazz,
        jlong bitmapPtr)
{
    SkBitmap nativeBitmap;
    bitmap::toBitmap(bitmapPtr).getSkBitmap(&nativeBitmap);
    bitmap::toSkBitmap(bitmapPtr, &nativeBitmap);
    return getType(nativeBitmap.colorType());
}

@@ -723,7 +727,7 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz,
        jlong bitmapPtr, jint type, jint border)
{
    SkBitmap bitmap;
    bitmap::toBitmap(bitmapPtr).getSkBitmap(&bitmap);
    bitmap::toSkBitmap(bitmapPtr, &bitmap);
    SkColorType colorType = bitmap.colorType();
    if (internalformat < 0) {
        internalformat = getInternalFormat(colorType);
@@ -751,7 +755,7 @@ static jint util_texSubImage2D(JNIEnv *env, jclass clazz,
        jlong bitmapPtr, jint format, jint type)
{
    SkBitmap bitmap;
    bitmap::toBitmap(bitmapPtr).getSkBitmap(&bitmap);
    bitmap::toSkBitmap(bitmapPtr, &bitmap);
    SkColorType colorType = bitmap.colorType();
    int internalFormat = getInternalFormat(colorType);
    if (format < 0) {
+0 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */

#include "jni.h"
#include "GraphicsJNI.h"
#include <nativehelper/JNIHelp.h>

#include <minikin/Layout.h>
+7 −7
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#ifndef _ANDROID_NIO_UTILS_H_
#define _ANDROID_NIO_UTILS_H_

#include <android_runtime/AndroidRuntime.h>
#include <nativehelper/JNIHelp.h>

namespace android {

@@ -68,12 +68,12 @@ private:
    AutoBufferPointer() = delete;
    AutoBufferPointer(AutoBufferPointer&) = delete;
    AutoBufferPointer& operator=(AutoBufferPointer&) = delete;
    static void* operator new(std::size_t);
    static void* operator new[](std::size_t);
    static void* operator new(std::size_t, void*);
    static void* operator new[](std::size_t, void*);
    static void operator delete(void*, std::size_t);
    static void operator delete[](void*, std::size_t);
    static void* operator new(size_t);
    static void* operator new[](size_t);
    static void* operator new(size_t, void*);
    static void* operator new[](size_t, void*);
    static void operator delete(void*, size_t);
    static void operator delete[](void*, size_t);
};

}   /* namespace android */
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#define LOG_TAG "OpenGLRenderer"

#include "jni.h"
#include "GraphicsJNI.h"
#include <nativehelper/JNIHelp.h>
#include <android_runtime/AndroidRuntime.h>

Loading