summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Dixon <joth@google.com>2012-12-26 11:55:54 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-12-26 11:55:54 -0800
commitd72ea1e90563e7d3056eef86c3c7dd0c526b718f (patch)
treea248c720fe07ed9b6a7bf53bd1fec235e6e48591
parent8a8a1f9b5ea238437196790b89f4dbec78fda4e9 (diff)
downloadwebview-d72ea1e90563e7d3056eef86c3c7dd0c526b718f.tar.gz
Revert "Connect up DrawSW interface"
This reverts commit 8a8a1f9b5ea238437196790b89f4dbec78fda4e9 The dependent patch hadn't yet rolled into Android tree - will re-land this one when it does. Change-Id: If4241162a9c26997cdd6636b17cbd4182ac85096
-rw-r--r--chromium/Android.mk15
-rw-r--r--chromium/java/com/android/webview/chromium/GraphicsUtils.java26
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java1
-rw-r--r--chromium/plat_support/draw_gl_functor.cpp6
-rw-r--r--chromium/plat_support/graphics_utils.cpp111
-rw-r--r--chromium/plat_support/jni_entry_point.cpp2
6 files changed, 8 insertions, 153 deletions
diff --git a/chromium/Android.mk b/chromium/Android.mk
index afa3cb7..1830803 100644
--- a/chromium/Android.mk
+++ b/chromium/Android.mk
@@ -27,7 +27,7 @@ LOCAL_MODULE := webviewchromium
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES += google-common \
- android_webview_java \
+ android_webview_java
LOCAL_SRC_FILES := $(call all-java-files-under, java)
@@ -35,7 +35,7 @@ LOCAL_REQUIRED_MODULES := \
libwebviewchromium \
libwebviewchromium_plat_support \
webviewchromium_pak \
- webviewchromium_strings_pak \
+ webviewchromium_strings_pak
LOCAL_PROGUARD_ENABLED := disabled
@@ -49,19 +49,14 @@ LOCAL_MODULE:= libwebviewchromium_plat_support
LOCAL_SRC_FILES:= \
plat_support/draw_gl_functor.cpp \
- plat_support/jni_entry_point.cpp \
- plat_support/graphics_utils.cpp \
+ plat_support/jni_entry_point.cpp
LOCAL_C_INCLUDES:= \
- $(CHROMIUM_PATH) \
- external/skia/include/core \
- frameworks/base/core/jni/android/graphics \
+ $(CHROMIUM_PATH)
LOCAL_SHARED_LIBRARIES += \
- libandroid_runtime \
- libcutils \
- libskia \
libutils \
+ libcutils
LOCAL_MODULE_TAGS := optional
diff --git a/chromium/java/com/android/webview/chromium/GraphicsUtils.java b/chromium/java/com/android/webview/chromium/GraphicsUtils.java
deleted file mode 100644
index d5e9c4a..0000000
--- a/chromium/java/com/android/webview/chromium/GraphicsUtils.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.webview.chromium;
-
-abstract class GraphicsUtils {
- public static int getDrawSWFunctionTable() {
- return nativeGetDrawSWFunctionTable();
- }
-
- private static native int nativeGetDrawSWFunctionTable();
-
-}
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
index ad45d75..a1a0d3b 100644
--- a/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
+++ b/chromium/java/com/android/webview/chromium/WebViewChromiumFactoryProvider.java
@@ -66,7 +66,6 @@ public class WebViewChromiumFactoryProvider implements WebViewFactoryProvider {
// Load glue-layer support library.
System.loadLibrary("webviewchromium_plat_support");
DrawGLFunctor.setChromiumAwDrawGLFunction(AwContents.getAwDrawGLFunction());
- AwContents.setAwDrawSWFunctionTable(GraphicsUtils.getDrawSWFunctionTable());
}
// TODO(joth): Much of this initialization logic could be moved into the chromium tree.
diff --git a/chromium/plat_support/draw_gl_functor.cpp b/chromium/plat_support/draw_gl_functor.cpp
index c07e2db..e9474bd 100644
--- a/chromium/plat_support/draw_gl_functor.cpp
+++ b/chromium/plat_support/draw_gl_functor.cpp
@@ -112,11 +112,11 @@ void SetChromiumAwDrawGLFunction(JNIEnv*, jclass, jint draw_function) {
const char kClassName[] = "com/android/webview/chromium/DrawGLFunctor";
const JNINativeMethod kJniMethods[] = {
{ "nativeCreateGLFunctor", "(I)I",
- reinterpret_cast<void*>(CreateGLFunctor) },
+ reinterpret_cast<void*>(CreateGLFunctor), },
{ "nativeDestroyGLFunctor", "(I)V",
- reinterpret_cast<void*>(DestroyGLFunctor) },
+ reinterpret_cast<void*>(DestroyGLFunctor), },
{ "nativeSetChromiumAwDrawGLFunction", "(I)V",
- reinterpret_cast<void*>(SetChromiumAwDrawGLFunction) },
+ reinterpret_cast<void*>(SetChromiumAwDrawGLFunction), },
};
} // namespace
diff --git a/chromium/plat_support/graphics_utils.cpp b/chromium/plat_support/graphics_utils.cpp
deleted file mode 100644
index c9e519b..0000000
--- a/chromium/plat_support/graphics_utils.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Provides a webviewchromium glue layer adapter from the internal Android
-// graphics types into the types the chromium stack expects, and back.
-
-#define LOG_TAG "webviewchromium_plat_support"
-
-#include "android_webview/public/browser/draw_sw.h"
-
-#include <cstdlib>
-#include <jni.h>
-#include <utils/Log.h>
-#include "GraphicsJNI.h"
-
-#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
-
-namespace android {
-namespace {
-
-struct PixelInfo : public AwPixelInfo {
- PixelInfo(const SkBitmap* bitmap)
- : bitmap_(bitmap) {
- this->bitmap_->lockPixels();
- }
- ~PixelInfo() {
- this->bitmap_->unlockPixels();
- free(clip_region);
- };
- const SkBitmap* bitmap_;
-};
-
-AwPixelInfo* GetPixels(JNIEnv* env, jobject java_canvas) {
- SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, java_canvas);
- if (!canvas) return NULL;
- SkDevice* device = canvas->getDevice();
- if (!device) return NULL;
- const SkBitmap* bitmap = &device->accessBitmap(true);
- if (!bitmap->lockPixelsAreWritable()) return NULL;
-
- PixelInfo* pixels = new PixelInfo(bitmap);
- pixels->config = bitmap->config();
- pixels->width = bitmap->width();
- pixels->height = bitmap->height();
- pixels->row_bytes = bitmap->rowBytes();
- pixels->pixels = bitmap->getPixels();
- const SkMatrix& matrix = canvas->getTotalMatrix();
- for (int i = 0; i < 9; i++) {
- pixels->matrix[i] = matrix.get(i);
- }
- // TODO: getTotalClip() is now marked as deprecated, but the replacement,
- // getClipDeviceBounds, does not return the exact region, just the bounds.
- // Work out what we should use instead.
- const SkRegion& region = canvas->getTotalClip();
- pixels->clip_region = NULL;
- pixels->clip_region_size = region.writeToMemory(NULL);
- if (pixels->clip_region_size) {
- pixels->clip_region = malloc(pixels->clip_region_size);
- size_t written = region.writeToMemory(pixels->clip_region);
- ALOG_ASSERT(written == pixels->clip_region_size);
- }
- // WebViewClassic used the DrawFilter for its own purposes (e.g. disabling
- // dithering when zooming/scrolling) so for now at least, just ignore any
- // client supplied DrawFilter.
- ALOGW_IF(canvas->getDrawFilter(),
- "DrawFilter not supported in webviewchromium, will be ignored");
- return pixels;
-}
-
-void ReleasePixels(AwPixelInfo* pixels) {
- delete static_cast<PixelInfo*>(pixels);
-}
-
-jint GetDrawSWFunctionTable(JNIEnv* env, jclass) {
- static const AwDrawSWFunctionTable function_table = {
- &GetPixels,
- &ReleasePixels,
- };
- return reinterpret_cast<jint>(&function_table);
-}
-
-const char kClassName[] = "com/android/webview/chromium/GraphicsUtils";
-const JNINativeMethod kJniMethods[] = {
- { "nativeGetDrawSWFunctionTable", "()I",
- reinterpret_cast<void*>(GetDrawSWFunctionTable) },
-};
-
-} // namespace
-
-void RegisterGraphicsUtils(JNIEnv* env) {
- jclass clazz = env->FindClass(kClassName);
- LOG_ALWAYS_FATAL_IF(!clazz, "Unable to find class '%s'", kClassName);
-
- int res = env->RegisterNatives(clazz, kJniMethods, NELEM(kJniMethods));
- LOG_ALWAYS_FATAL_IF(res < 0, "register native methods failed: res=%d", res);
-}
-
-} // namespace android
diff --git a/chromium/plat_support/jni_entry_point.cpp b/chromium/plat_support/jni_entry_point.cpp
index 4771be1..6293fa5 100644
--- a/chromium/plat_support/jni_entry_point.cpp
+++ b/chromium/plat_support/jni_entry_point.cpp
@@ -22,7 +22,6 @@
namespace android {
void RegisterDrawGLFunctor(JNIEnv* env);
-void RegisterGraphicsUtils(JNIEnv* env);
} // namespace android
@@ -31,7 +30,6 @@ JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
jint ret = vm->AttachCurrentThread(&env, NULL);
LOG_ALWAYS_FATAL_IF(ret != JNI_OK, "AttachCurrentThread failed");
android::RegisterDrawGLFunctor(env);
- android::RegisterGraphicsUtils(env);
return JNI_VERSION_1_4;
}